PHP Curl, retrieving Server IP Address

前端 未结 6 1164
迷失自我
迷失自我 2021-02-08 21:52

I\'m using PHP CURL to send a request to a server. What do I need to do so the response from server will include that server\'s IP address?

6条回答
  •  太阳男子
    2021-02-08 22:34

    echo '
    ';
    print_r(gethostbynamel($host));
    echo '
    ';

    That will give you all the IP addresses associated with the given host name.

提交回复
热议问题