当前位置 : 主页 > 网络编程 > PHP >

截取指定区间字符串.txt

来源:互联网 收集:自由互联 发布时间:2021-06-28
截取指定区间字符串.txt private function get_between($str,$start = '',$end = '') { $start = html_entity_decode($start); $end = html_entity_decode($end); $s1 = strstr($str,$start); $str = $s1 ? $s1 : $str; $e_leng = strpos($str,$end)
截取指定区间字符串.txt
private function get_between($str,$start = '',$end = '') {
        $start = html_entity_decode($start);
        $end = html_entity_decode($end);
        $s1 = strstr($str,$start);
        $str = $s1 ? $s1 : $str;
        $e_leng = strpos($str,$end);
        $str = substr($str,0,$e_leng);
        $str = str_replace($start,'',$str);
        return trim($str);
    }
网友评论