Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>if you want to call the xml API the URL is </p> <pre><code>$location = 'http://www.geoplugin.net/xml.gp?ip='.$_SERVER['REMOTE_ADDR']; $xml = simplexml_load_file($location); </code></pre> <p>Output Sample</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;geoPlugin&gt; &lt;geoplugin_city&gt;Lagos&lt;/geoplugin_city&gt; &lt;geoplugin_region&gt;Lagos&lt;/geoplugin_region&gt; &lt;geoplugin_areaCode&gt;0&lt;/geoplugin_areaCode&gt; &lt;geoplugin_dmaCode&gt;0&lt;/geoplugin_dmaCode&gt; &lt;geoplugin_countryCode&gt;NG&lt;/geoplugin_countryCode&gt; &lt;geoplugin_countryName&gt;Nigeria&lt;/geoplugin_countryName&gt; &lt;geoplugin_continentCode&gt;AF&lt;/geoplugin_continentCode&gt; &lt;geoplugin_latitude&gt;6.4531002044678&lt;/geoplugin_latitude&gt; &lt;geoplugin_longitude&gt;3.395800113678&lt;/geoplugin_longitude&gt; &lt;geoplugin_regionCode&gt;05&lt;/geoplugin_regionCode&gt; &lt;geoplugin_regionName&gt;Lagos&lt;/geoplugin_regionName&gt; &lt;geoplugin_currencyCode&gt;NGN&lt;/geoplugin_currencyCode&gt; &lt;geoplugin_currencySymbol&gt;&amp;#8358;&lt;/geoplugin_currencySymbol&gt; &lt;geoplugin_currencyConverter&gt;157.6899963379&lt;/geoplugin_currencyConverter&gt; &lt;/geoPlugin&gt; </code></pre> <p><strong>EDIT 1</strong></p> <pre><code>echo "&lt;pre&gt;"; foreach($xml as $key =&gt; $value) { echo $key , " = " , $value , "\n" ; } </code></pre> <p>Output </p> <pre><code>geoplugin_city = Lagos geoplugin_region = Lagos geoplugin_areaCode = 0 geoplugin_dmaCode = 0 geoplugin_countryCode = NG geoplugin_countryName = Nigeria geoplugin_continentCode = AF geoplugin_latitude = 6.4531002044678 geoplugin_longitude = 3.395800113678 geoplugin_regionCode = 05 geoplugin_regionName = Lagos geoplugin_currencyCode = NGN geoplugin_currencySymbol = ₦ geoplugin_currencyConverter = 157.6899963379 </code></pre> <p>Thanks</p> <p>:)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload