Track location using Ip Address in Php

Track location using Ip Address in Php

Track location using Ip Address in Php

track location by ip address in php 

<?php 

$ip = getenv("REMOTE_ADDR") ; $url = "https://ipinfo.io/".$ip."/json"; $userInfo = file_get_contents($url); $result = json_decode($userInfo,true); echo "<b>IP Address : </b>".$result['ip']."<br>"; echo "<b>City : </b>".$result['city']."<br>"; echo "<b>State : </b>".$result['region']."<br>"; echo "<b>Country Code : </b>".$result['country']."<br>"; echo "<b>Latitude & Longitude : </b>".$result['loc']."<br>"; echo "<b>Timezone : </b>".$result['timezone']."<br>"; ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top