gethostname

PHP 5 >= 5.3.0, PHP 7, PHP 8
gethostname - Gets the host name
Manual
Code Examples

gethostname( ): string|false

gethostname gets the standard host name for the local machine.

Parameters

This function has no parameters.

Return Values

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

Related Functions

Example of gethostname

Show all examples for gethostname

PHP Version: