array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.gethostname.php', 1 => 'gethostname', 2 => 'Gets the host name', ), 'up' => array ( 0 => 'ref.network.php', 1 => 'Функції для мережі', ), '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', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

gethostname

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

gethostnameGets the host name

Опис

gethostname(): string|false

gethostname() gets the standard host name for the local machine.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns a string with the hostname on success, otherwise false is returned.

Приклади

Приклад #1 A simple gethostname() example

<?php
echo gethostname(); // may output e.g,: sandie
?>

Прогляньте також