Get public IP address of system using php
Get public IP address of system using php
Get public IP address of system using php
Get the ip address of the system [usually assigned by ISP], the public ip address using PHP. This code should run on a Windows server.
ob_start(); system('ipconfig /all'); $mycom=ob_get_contents(); // Capture the output into a variable ob_clean(); $findme = "IP Address"; $pos = strpos($mycom, $findme); $ip=substr($mycom,($pos+36),17); echo "The IP address of this system is :".$ip;
Check Get MAC Address Using PHP (Linux & Windows)
Here we are using Output buffer. CLICK HERE to take a look at what is Output buffering in php.