Convert Hostname to IP Address using PHP

gethostbyname function

<?php

$hostname = 'google.com';
$ip = gethostbyname($hostname);

echo $ip;

Leave a Comment

Cancel reply

Your email address will not be published.