Question:
You run the following PHP Script:
<?php
$value = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $value;
?>
What will be the output of the script?
A. It will print the DNS resource records associated with the local Web Server.
B. It will print the standard host name for the local Web Server.
C. It will print the list of header information sent.
D. It will print the host name of the Internet host.
Explanation:
You run the following PHP Script:
<?php
$value = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $value;
?>
What will be the output of the script?
A. It will print the DNS resource records associated with the local Web Server.
B. It will print the standard host name for the local Web Server.
C. It will print the list of header information sent.
D. It will print the host name of the Internet host.
Explanation:
$_SERVER is an array containing information such as headers, paths, and script locations.
Answer: D
Related Functions:
Predefined variables:
PHP provides a large number of predefined variables to all scripts. The variables represent everything from external variables to built-in environment variables, last error messages to last retrieved headers.
List of predefined variables of PHP