PHP Curl, retrieving Server IP Address

前端 未结 6 1167
迷失自我
迷失自我 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:26

    I used this one


    "; foreach ($hosts as $ip) { echo "IP: ".$ip."
    "; } } else { echo "Host ".$hostname." is not tied to any IP."; } ?>

    from here: http://php.net/manual/en/function.gethostbynamel.php

提交回复
热议问题