正则表达式 - 翼展电脑服务中心


用正则表达式匹配网址

2018-9-23 乱云飞 评论(0) 浏览(832) 标签: 正则表达式 匹配网址

$str = 'ftp://xfgdf.cctfdghfdghgfdhrtfdthg';
$isMatched = preg_match('/^^((https|http|ftp|rtsp|rtmp|mms)?:\/\/)[^\s]+$/', $str, $matches);
echo $matches[0];
预ICP备10086-001号 © 翼展网/80C.CC 技术支持/洛阳翼展科技
TEL / 13213610060 QQ / 345794501
Powered by emlog