Best way to get hostname with php

前端 未结 6 2011
别跟我提以往
别跟我提以往 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 04:30

    I am running PHP version 5.4 on shared hosting and both of these both successfully return the same results:

    php_uname('n');
    
    gethostname();
    

提交回复
热议问题