用正则表达式匹配网址
$str = 'ftp://xfgdf.cctfdghfdghgfdhrtfdthg';
$isMatched = preg_match('/^^((https|http|ftp|rtsp|rtmp|mms)?:\/\/)[^\s]+$/', $str, $matches);
echo $matches[0];本文链接:http://80c.cc/ez/175.html
$str = 'ftp://xfgdf.cctfdghfdghgfdhrtfdthg';
$isMatched = preg_match('/^^((https|http|ftp|rtsp|rtmp|mms)?:\/\/)[^\s]+$/', $str, $matches);
echo $matches[0];本文链接:http://80c.cc/ez/175.html
发表评论: