How to get the IP address of a website using PHP
In this tutorial, we will learn How to get the IP address of a website using PHP. Simple use to get an IP address using PHP. Most of us get IP addresses to get using the command line (CMD). But in this tutorial get the IP address of the website using PHP. We will find out the IP address of devnote.in website.
Get IP Address Of Website
Get the IP address of a website, you can use the gethostbyname()
PHP default function. gethostbyname()
function returning the IPV4 address of the supplied hostname or URL.
<?php $url = "devnote.in"; $ip_address = gethostbyname($url); echo $url. " web site IP Address is : ".$ip_address; Output: devnote.in web site IP Address is : 162.241.148.160