直接源码:
// 是否url验证
public function v_url($value,$limit=true)
{
if ($limit) {
if (is_url($value)) {
return true;
}
else{
return false;
}
}
else{
return true;
}
}
function is_url($str){
return preg_match("/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\’:+!]*([^<>\"])*$/", $str);
}
学习推荐:
《thinkphp5经典案例》 http://www.kancloud.cn/duerhong/rumen/308144
thinkphp 精英群:536633782