PHP截取字符串

function GetBetween($content,$start,$end){
    $r = explode($start, $content);
    if (isset($r[1])){
        $r = explode($end, $r[1]);
        return $r[0];
    }
    return '';
}

echo GetBetween("abcdefghijklmnopqrstuvw","def","t");
//输出:ghijklmnopqrs

posted on 2012-04-05 21:25  IT技术畅销书  阅读(115)  评论(0编辑  收藏  举报

导航