PHP display server IP Address

后端 未结 3 2041
野趣味
野趣味 2021-02-05 06:50

I\'m working on a website, and one of the things I would like to do is display MY IP address to users. The website is made with CodeIgniter, so I was looking to find my server

3条回答
  •  心在旅途
    2021-02-05 07:13

    If your laravel application is running on an internal server, you can use the following to get the external address of the server:

     $external_ip = exec('curl http://ipecho.net/plain; echo');
    

提交回复
热议问题