Thursday, 18 May 2017

How to Know IP Location with their city code,Region Code, Country Code,Latitude & Longitude also.

A Simple function for finding the IP location  with their city code,Region Code, Country Code, Latitude & Longitude.



<html>

<head>

  <title>Display IP Location with Full Information </title>

  <link href="<?php echo base_url(); ?>css/bootstrap.min.css" rel="stylesheet">

</head>

  

<body>

    

 <div class="fluid-container">

   <div class="row">

      <div class="col-md-12">&nbsp;</div>

         <div class="col-md-12">

          <div class="col-md-3"></div>

           <div class="col-md-6">

           <?php

           function getiplocationdetails()

          {

             $ip = '192.190.85.178';

             $result = '';

             $ip_datails = @json_decode

            (file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip)); 

             return $ip_datails;

              }





              echo "<>";

              print_r(getiplocationdetails());

              ?>

              </div>

              <div class="col-md-3"></div>

            </div>

         </div>

     </div>

  </body>

</html>




0 comments:

Post a Comment