PHP determines whether to connect to the network, and php determines whether to connect to the network. PHP determines whether to connect to the network. php determines whether to connect to the network. This article describes how to determine whether to connect to the network by PHP. Share it with you for your reference. The specific implementation method is as follows: PHP determines whether to connect to the network. php determines whether to connect to the network.
This example describes how to determine whether PHP is connected to the network. Share it with you for your reference. The specific implementation method is as follows:
First, write a function.
Function varify_url ($ url) {$ check = @ fopen ($ url, "r"); if ($ check) {$ status = true ;} else {$ status = false;} return $ status ;}
Then you can directly call it as needed.
$ Url = "http://www.baidu.com"; if (varify_url ($ url) {echo"Congratulation! Your URL $ url: isValid
";} Else {echo"Error! Your URL: $ url isInvalid
";}
I hope this article will help you with php programming.
Examples in this article describes how to determine whether PHP is connected to the network. Share it with you for your reference. The specific implementation method is as follows...