标签: PHP

  • PHP 截取两个指定字符中间内容

    适合采集等程序使用

    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