Php cleverly obtains server information
$ Fp = fopen ("http: // www. ***. com /***. htm "," r "); // open files under a site in read-only mode
Foreach ($ http_response_header as $ info) // traverse the file information header of $ http_response_header
Echo $ info ."
";," R "); // open files under a site in read-only mode
Foreach ($ http_response_header as $ info) // traverse the file information header of $ http_response_header
Echo $ info ."
"; // Finally output the information of each record
?>
In the information header, the content displayed includes whether the file exists, the file size, file type, and encoding method, you can even obtain the server name and version number used by the site. If you open files such as ASP or PHP, additional information is contained.
Simpler method
$ Fp = fopen ("http: // www. ***. com /***. htm "," r "); // open files under a site in read-only mode
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.