Best way to get hostname with php

前端 未结 6 1975
别跟我提以往
别跟我提以往 2020-12-05 03:51

I have a php application that is installed on several servers and all of our developers laptops. I need a fast and reliable way to get the server\'s hostname or some other

6条回答
  •  有刺的猬
    2020-12-05 04:38

    What about gethostname()?

    Edit: This might not be an option I suppose, depending on your environment. It's new in PHP 5.3. php_uname('n') might work as an alternative.

提交回复
热议问题