Finding Client’s IP address, Country, State, City using api in PHP

If you want to get client’s IP address you will use $_SERVER[‘REMOTE_ADDR’] function in PHP. But you will not get the real IP address of the client. To get the real IP address You can use the method I used. Also With this method you can also find the City, State, Country client’s in. The code is pretty simple. With the help of it was pretty easy. [email protected]_get_contents(‘’);if (empty($response)){throw new InvalidArgumentException(“Error contacting Geo-IP-Server”);}$patterns=array();$patterns[“state”] = ‘#State/Region: (.