PHP | gethostname() Function

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

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 - 

 gethostname()

Example - 

 <?php

   echo gethostname();
?>


Parameters: This function doesn’t accept any parameters.

Return Value: This function returns the host or domain name on success and FALSE on failure.

for more details visit -  https://www.php.net/manual/en/function.gethostname.php

2 comments:

Pulp Strategy said...

I am really impressed with your blog article, such great & useful knowledge you mentioned here. Your post is very informative. We are Digital Marketing Consultant Digital Marketing Agency in India

Marc Enners said...

Nice Informative blog to read. Thanks for sharing nice information. It really helps me a lot surely it will help others. Keep sharing.
web design sydney

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...