How to identify server IP address in PHP

后端 未结 15 971
温柔的废话
温柔的废话 2020-11-29 23:52

How can I identify the server IP address in PHP?

15条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 00:18

    Like this for the server ip:

    $_SERVER['SERVER_ADDR'];
    

    and this for the port

    $_SERVER['SERVER_PORT'];
    

提交回复
热议问题