记录一下php正则检测网址是否包含http、https字符,代码如下
$url = "https://www.baidu.com/";
$preg = "/^http(s)?:\\/\\/.+/";
if(preg_match($preg,$url)){
echo 'Yes';
}else{
echo 'No';
}
记录一下php正则检测网址是否包含http、https字符,代码如下
$url = "https://www.baidu.com/";
$preg = "/^http(s)?:\\/\\/.+/";
if(preg_match($preg,$url)){
echo 'Yes';
}else{
echo 'No';
}
链接到文章: https://ixvps.com/47225.html