문제

I need to get the IP address of a domain by the domain name.

  1. Site: hotmail.com / 65.55.72.151
  2. Site: domain.com / 65.254.244.180

Can it be done, and in that case, how can I do it?

도움이 되었습니까?

해결책

You can use this code:

<?php
$ip = gethostbyname('www.site.com');

echo $ip;
?>

Or, you could operate it dynamically...

<?php
$url = $_GET['url'];
$ip = gethostbyname($url);

echo $ip;
?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top