I want to be able to navigate to the coordinates within the following table:
{
"type": "Polygon",
"coordinates": [
[
[
37.02255983,
-1.43654556
],
[
37.08298464,
-1.41777117
],
[
37.03893607,
-1.44272341
],
[
36.96500169,
-1.48081985
],
[
36.91303988,
-1.47429887
]
]
]
}
I am pulling this data from a database and my first level looping results in the above object array. My first level code is as follows:
<?php
$locations = \App\Model::all();
foreach ($locations as $key=>$location)
{
$polygonXML = $location['polygon'];
dd($polygonXML);
}
?>
I want to end up with the coordinate key.