SyntaxFix
Write A Post
Hire A Developer
Questions
If you are using PHP in bash shell you can use:
$server_name=exec('hostname');
Because $_SERVER[] SERVER_ADDR, HTTP_HOST and SERVER_NAME are not set.
$_SERVER[] SERVER_ADDR
HTTP_HOST
SERVER_NAME