输入banner图图片脚本导航/分类

php截取函数intercept_str详解

本文主要和大家分享php截取函数intercept_str详解,主要以一段代码和大家分享,希望能帮助到大家。

下面粘贴上此函数的实现

function intercept_str($str,$start,$end,$option = 1){
		$strarr=explode($start,$str);
		$tem=$strarr[1];
		if(empty($end)){
		return $tem;
		}else{
		$strarr=explode($end,$tem);
		if($option==1){
		return $strarr[0];
		}
		if($option==2){
		return $start.$strarr[0];
		}
		if($option==3){
		return $strarr[0].$end;
		}else{
		return $start.$strarr[0].$end;
		}
		}
}

以上就是php截取函数intercept_str详解的详细内容,更多请关注Gxl网其它相关文章!