PHP GET IP BY DOMAIN

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

echo $ip;
?>
Nasty Newt