PHP detects URL address validity
The code is as follows
function is_url($str){
return preg_match("/^http://[A-Za-z0-9] .[A-Za-z0-9] [/=?%-&_~`@[]': !]*([^< ;>"])*$/", $str);
}
?>
If you want to try if it works normally, we can use the file_get_contents() function to verify it.