按照指定符号截取字符串

 function preMatch($i,$str){
    preg_match_all('/([^;]{1,};){2}/',$args,$matches);
    if(!empty($matches[0])){
        $str="";
        foreach($matches[0] as $substr)
        {
            $str.=$substr;
        }
        $len=strlen($str);
        $subStr= substr($args,$len);
        if(isset($subStr))
            array_push ($matches[0], $subStr);
        print_r($matches[0]);exit;
    }
    else
        print_r ($args);
}

原文地址:https://www.cnblogs.com/lsl8966/p/2851070.html