array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.gethostname.php', 1 => 'gethostname', ), 'up' => array ( 0 => 'ref.network.php', 1 => 'Funções da Network', ), 'prev' => array ( 0 => 'function.gethostbynamel.php', 1 => 'gethostbynamel', ), 'next' => array ( 0 => 'function.getmxrr.php', 1 => 'getmxrr', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/network/functions/gethostname.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
gethostname — Gets the host name
gethostname() gets the standard host name for the local machine.
Esta função não possui parâmetros.
Returns a string with the hostname on success, otherwise false
is
returned.
Exemplo #1 A simple gethostname() example
<?php
echo gethostname(); // may output e.g,: sandie
?>