function isvalidURL($url)
{
    $check = 0;
    if (filter_var($url, FILTER_VALIDATE_URL) !== false) {
      $check = 1;
    }
    return $check;
}

语法:

$url = "http://www.dmaku.com";
$check = checkvalidURL($url);
echo $check; //if returns 1 then URL is valid.


 标签 php检测 URL 是否有效
相关评论(0)
发 布 (Ctrl+Enter)
还没有评论,快来抢沙发吧!