Get Content from JSON File using PHP
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4317112/how-to-access-particular-fields-from-json-content-by-using-php">How to access particular fields from JSON content by using php?</a>  </p>
</blockquote>



<p>Hey,</p>

<p>I was wondering how to echo data from JSON files in PHP.</p>

<p>This is the JSON file:</p>

<p><a href="http://maps.google.co.uk/maps/geo?q=CF31+1TS&amp;output=json&amp;key=ABQIAAAAjmTRBgtgtF37-qE_f6KpZBRCBL1e3hyPoJsOko_kz4arbP9XmRQw2_r4kBROF8LfrykEp3D02xrMpQ" rel="nofollow">http://maps.google.co.uk/maps/geo?q=CF31+1TS&amp;output=json&amp;key=ABQIAAAAjmTRBgtgtF37-qE_f6KpZBRCBL1e3hyPoJsOko_kz4arbP9XmRQw2_r4kBROF8LfrykEp3D02xrMpQ</a></p>

<p>This is the data inside:</p>

<pre><code>{
    "name": "CF31 1TS",
    "Status": {
        "code": 200,
        "request": "geocode"
    },
    "Placemark": [ 
        {
            "id": "p1",
            "address": "Bridgend, Mid Glamorgan CF31 1TS, UK",
            "AddressDetails": {
                "Accuracy" : 5,
                "Country" : {
                    "AdministrativeArea" : {
                        "AdministrativeAreaName" : "Mid Glamorgan",
                        "Locality" : {
                            "LocalityName" : "Bridgend",
                            "PostalCode" : {
                                "PostalCodeNumber" : "CF31 1TS"
                            }
                        }
                    },
                    "CountryName" : "UK",
                    "CountryNameCode" : "GB"
                }
            },
            "ExtendedData": {
                "LatLonBox": {
                    "north": 51.5089014,
                    "south": 51.5026062,
                    "east": -3.5663943,
                    "west": -3.5726895
                }
            },
            "Point": {
                "coordinates": [ -3.5695419, 51.5057538, 0 ]
            }
        } 
    ]
}
</code></pre>

<p>I need the "coordinates" split up and make 'echoable'.</p>

<p><strong>For example:</strong></p>

<pre><code>$lat = "51.5057538";
$long = "-3.5695419";
</code></pre>

<p>Any help would be great, Thanks!</p>
