PHP正则匹配网址

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