php display information from string
<p>I have this code that gets the IP address and Latitude and Longitude of the user. However I am wanting ti display it on a map if it finds the lat and long. </p>

<pre><code>$theirip = $_SERVER['REMOTE_ADDR'];
$fileinfo = file_get_contents("http://api.easyjquery.com/ips/?ip=".$theirip."&amp;full=true");
</code></pre>

<p>This outputs a string like this.</p>

<blockquote>
  <p>{"IP":"000.000.00.000","continentCode":"Unknown","continentName":"Unknown","countryCode2":"Unknown","COUNTRY":"Unknown","countryCode3":"Unknown","countryName":"Unknown","regionName":"Unknown","cityName":"Unknown","cityLatitude":0,"cityLongitude":0,"countryLatitude":0,"countryLongitude":0,"localTimeZone":"Unknown","localTime":"0"}</p>
</blockquote>

<p>I am wanting to retrieve just the cityLatitude and cityLongitude from this. I have researched some and tried some different code.</p>

<pre><code>$lat = $fileinfo -&gt; {"cityLatitude"};
</code></pre>

<p>but i'm not quite sure how to go about this. Any help would be appreciated!</p>
