PHP gethostname() Function

❮ PHP Network Reference

Example

A gethostname() example:

<?php
echo gethostname();
?>


Definition and Usage

The gethostname() function returns the host name for the local machine.

Syntax

gethostname()

Technical Details

Return Value: The host name on success. FALSE on failure
PHP Version: 5.3+

❮ PHP Network Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.