note 126986 added to function.gethostname
| From: | markosjalATGmail at main dot php dot net | Date: | Wed, 13 Apr 2022 05:11:04 +0000 |
| Subject: | note 126986 added to function.gethostname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-218247@lists.php.net to get a copy of this message | ||
Since I built a PHP app that runs on Linux Windows and MacOS I just discovered that using
gethostname() behaves differently on different OSes. Linux will return "hostname" while
MacOS 10.15 will return "hostname.local" . Have yet to determine how Windows behaves but
the difference is worth noting. Only a few days ago I was wanting to get the LAN extension in Linux
and was never able to. I was oly hable to get "hostname". In MacOS it is just there. with
"hostname.local"
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 2601:1c2:4f01:e520:2d32:9a5f:9582:2392)
----
Manual Page -- https://php.net/manual/en/function.gethostname.php
Edit -- https://main.php.net/note/edit/126986
Del: integrated -- https://main.php.net/note/delete/126986/integrated
Del: useless -- https://main.php.net/note/delete/126986/useless
Del: bad code -- https://main.php.net/note/delete/126986/bad+code
Del: spam -- https://main.php.net/note/delete/126986/spam
Del: non-english -- https://main.php.net/note/delete/126986/non-english
Del: in docs -- https://main.php.net/note/delete/126986/in+docs
Del: other reasons-- https://main.php.net/note/delete/126986
Reject -- https://main.php.net/note/reject/126986
Search -- https://main.php.net/manage/user-notes.php