This is code for getting site's IP
$ip = gethostbyname(parse_url('http://www.wikipedia.com', PHP_URL_HOST));
print_r($ip);
but, what is the proper way to check with php does the website's IP redirects to site's domain?
EDITED: It seems I wasn't clear enough in my first question. The question is based on seositecheckup.com test. One of the warning there says:
IP Canonicalization Test
Your site's IP 198.35.26.96 does not redirect to your site's domain name. This could cause duplicate content problems if a search engine indexes your site under both its IP and domain name.
So, I'm asking how would I check by myself if the site's IP redirects to site's domain, in PHP