/**
* @param $url 网址
* @return bool
*/
public static function checkUrl($url){
$pattern="/^(http|https):\/\/([\w.]+\/?)\S$/i";
if(preg_match($pattern,$url)){
return true;
}else{
return false;
}
}
原文:https://www.cnblogs.com/jiqing9006/p/11972770.html