php dapatkan ip dari host
$ip = gethostbyname("google.com");
echo $ip; // 142.251.128.46
Willian Pinheiro
$ip = gethostbyname("google.com");
echo $ip; // 142.251.128.46
$exec = 'ipconfig | findstr /R /C:"IPv4.*"';
exec($exec, $output);
preg_match('/\d+\.\d+\.\d+\.\d+/', $output[0], $matches);
print_r($matches[0]);