Skip to main content
added 114 characters in body
Source Link

You can use this php code :

$localIP = getHostByName(getHostName());
  
// Displaying the address 
echo $localIP;

If you want get ipv4 of your system, Try this :

shell_exec("ip route get 1.2.3.4 | awk '{print $7}'")

You can use this php code :

$localIP = getHostByName(getHostName());
  
// Displaying the address 
echo $localIP;

You can use this php code :

$localIP = getHostByName(getHostName());
  
// Displaying the address 
echo $localIP;

If you want get ipv4 of your system, Try this :

shell_exec("ip route get 1.2.3.4 | awk '{print $7}'")
Source Link

You can use this php code :

$localIP = getHostByName(getHostName());
  
// Displaying the address 
echo $localIP;