PHP | gethostname() Function Last Updated : 03 Sep, 2019 Comments Improve Suggest changes Like Article Like Report The gethostname() function is an inbuilt function in PHP which returns the host or domain name for the local machine. This function is applicable after PHP 5.3.0 before that there was another function called php_uname function. Syntax: string gethostname( void ) Parameters: This function doesn't accept any parameters. Return Value: This function returns the host or domain name on success and FALSE on failure. Note: This function is available for PHP 5.3.0 and newer version. Below program illustrates the gethostname() function in PHP: Program: php <?php // Use gethostname() function to // get the host name echo gethostname(); ?> Output: pppContainer Reference: https://www.php.net/manual/en/function.gethostname.php Comment More infoAdvertise with us Next Article PHP | gethostname() Function G gekcho Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | gethostnamel() Function The gethostbynamel() function is an inbuilt function in PHP which returns a list of IPv4 address for a specified internet host/domain name. Syntax: gethostbynamel( string $hostname ) Parameters: This function accepts single parameter $hostname which is required. It specifies the hostname whose IPv4 1 min read PHP | gethostbyname() Function The gethostbyname() function is an inbuilt function in PHP which returns IPv4 address for a specified host/domain name. Syntax: string gethostbyname( $hostname ) Parameter: This function accepts single parameter $hostname which is required. It specifies the hostname whose IPv4 address to be found. R 1 min read PHP | getprotobyname() Function The getprotobyname() function is an inbuilt function in PHP which returns the protocol number for a specified protocol name. Syntax: int getprotobyname( string $name ) Parameters: This function accepts single parameter $name which is required. It specifies the protocol name, like tcp, icmp, udp, ip 1 min read PHP | getservbyname() Function The getservbyname() function is an inbuilt function in PHP which returns the port number for given protocol and Internet service. Syntax: int getservbyname( string $service, string $protocol ) Parameters: This function accepts two parameters as mentioned above and described below: $protocol: It is r 2 min read PHP | getprotobynumber() Function The getprotobynumber() function is an inbuilt function in PHP which returns the protocol name for a specified protocol number. Syntax: string getprotobynumber( int $protocol_number ) Parameters: This function accepts single parameter $protocol_number which is required. It specifies the protocol numb 1 min read PHP mhash_get_hash_name() Function The mhash_get_hash_name() function is an inbuilt function in PHP which is used to get the block size of the specified hash. It gets the highest available hash ID within the current MHash installed in the system like SHA1, MD%, etc. Syntax: string mhash_get_hash_name( int $hash ) Parameter: This func 1 min read PHP | geoip_isp_by_name() Function The geoip_isp_by_name() is an inbuilt function in PHP , which helps to get the ISP(Internet Service Provider) of the corresponding IP address .The function is available only for a commercial GeoIP ISP Edition user and gives a warning if the database is not found . Syntax : string geoip_isp_by_name ( 1 min read PHP | Reflection getShortName() Function The Reflection::getShortName() function is an inbuilt function in PHP which is used to return the short name of the specified class, the part without the namespace. Syntax: string Reflection::getShortName( void ) Parameters: This function does not accept any parameters. Return Value: This function r 1 min read PHP | timezone_name_get() Function The timezone_name_get() function is an inbuilt function in PHP which is used to return the name of the timezone. The date time object is sent as a parameter to the timezone_name_get() function and it returns the name of the timezone on success or False on failure. Syntax: string timezone_name_get( $ 2 min read PHP | Reflection getName() Function The Reflection::getName() function is an inbuilt function in PHP which is used to return the name of the specified class. Syntax: string Reflection::getName( void ) Parameters: This function does not accept any parameters. Return Value: This function returns the name of the specified class. Below pr 1 min read Like