适合采集等程序使用
1 2 3 4 5 6 7 8 9 10 |
function intercept_str($start,$end,$str) { if(empty($start)||empty($end)||empty($str))return "参数不正确"; $strarr=explode($start,$str); $str=$strarr[1]; $strarr=explode($end,$str); return $strarr[0]; } //使用方法 echo intercept_str('www.','.com','www.dj3w.com') //将返回'dj3w |