How do I get something in PHP/Curl to grab the IP of the URL for me? It's going to be a simple interface that fetches URL IP's back for me.
E.g. Enter "http://mysite.com" then I hit submit then I should get the IP of the mysite.com back.
gethostbyname
$ip_string = gethostbyname( "stackoverflow.com" );
echo $ip_string; //returns ip address, ie 12.34.56.78
Try the gethostbyname
function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With