how to identify the web server name of remote host



PHP Snippet 1:

$url = 'http://php.net';
print_r(get_headers($url));

PHP Snippet 2:

Array
(
    [0] => HTTP/1.1 200 OK
    [1] => Server: nginx/1.6.2
    [2] => Date: Fri, 08 May 2015 13:21:44 GMT
    [3] => Content-Type: text/html; charset=utf-8
    [4] => Connection: close
    [5] => X-Powered-By: PHP/5.6.7-1
    [6] => Last-Modified: Fri, 08 May 2015 13:10:12 GMT
    [7] => Content-language: en
    [8] => X-Frame-Options: SAMEORIGIN
    [9] => Set-Cookie: COUNTRY=NA%2C95.77.98.186; expires=Fri, 15-May-2015 13:21:44 GMT; Max-Age=604800; path=/; domain=.php.net
    [10] => Set-Cookie: LAST_NEWS=1431091304; expires=Sat, 07-May-2016 13:21:44 GMT; Max-Age=31536000; path=/; domain=.php.net
    [11] => Link: <http://php.net/index>; rel=shorturl
    [12] => Vary: Accept-Encoding
)

PHP Snippet 3:

$url = 'http://php.net';
$headers = get_headers($url, true);
echo $headers['Server']; //ngnix/1.6.2

PHP Snippet 4:

$_SERVER['SERVER_SOFTWARE']

PHP Snippet 5:

$_SERVER['SERVER_SIGNATURE']

PHP Snippet 6:

gethostbyaddr($_SERVER['REMOTE_ADDR']);