It will print the host name of the Internet host.
Correct:
It will print the host name of the Internet host.
Explanation:
Answer option C is correct.
The gethostbyaddr()
PHP function is used to retrieve the Internet host name corresponding to a given IP address. Hence, consider the following PHP script:
<?php
$a = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $a;
?>
The output will be the host name of the remote host.
Answer option D is incorrect. The gethostname()
function gets the standard host name for the local machine. Hence, in order to get the standard host name for the local Web server, you will run the following script:
<?php
$a = gethostname();
echo $a;
?>
Answer option A is incorrect. You can get the DNS resource records associated with the local Web server by using the dns_get_record()
function.
Answer option B is incorrect. You can print the header list by using the headers_list() function.
Reference: php.net