You can check your ip address for your machine by using the following code:
If you wanted to check whether the IP address got changed then try with the below statement.
And, it was showing the new ip address. But below statement is still showing the old ip address.
So, If you would like to know whether $_SERVER[‘SERVER_ADDR’] is the correct way of knowing the IP address of the server.
Use the below function for finding actual IP address.
if (!empty($_SERVER[‘HTTP_CLIENT_IP’])) //check ip from share internet
elseif (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])) //to check ip is pass from proxy