I'm trying to get the HTTP headers but just the server software example: Apache, Microsoft-iis,Nginx,etc
The function
get_headers($url,1);
it is too slow i want to set time out if it is possible or an other way ??
thanks
I'm trying to get the HTTP headers but just the server software example: Apache, Microsoft-iis,Nginx,etc
The function
get_headers($url,1);
it is too slow i want to set time out if it is possible or an other way ??
thanks
For the local server, the $_SERVER variable will give you everything exposed by the web server in SERVER_* keys.
For remote servers you can use libcurl and request just the headers. Then parse the response. It can still be long delay depending on network connectivity and the speed of the other server. To avoid a long delay, e.g. for an offline server, set the curl option for a short timeout (e.g. 5 seconds) using curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5)
.