GETHOSTNAME(3) 1 GETHOSTNAME(3)
gethostname - Gets the host name
SYNOPSIS
string gethostname (void )
DESCRIPTION
gethostname(3) gets the standard host name for the local machine.
RETURN VALUES
Returns a string with the hostname on success, otherwise FALSE is returned.
EXAMPLES
Example #1
A simple gethostname(3) example
<?php
echo gethostname(); // may output e.g,: sandie
// Or, an option that also works before PHP 5.3
echo php_uname('n'); // may output e.g,: sandie
?>
SEE ALSO
gethostbyname(3), gethostbyaddr(3), php_uname(3).
PHP Documentation Group GETHOSTNAME(3)