Could anyone explain how does structure of that array look like?
$result['results'][0]['geometry']['location']
Could anyone explain how does structure of that array look like?
$result['results'][0]['geometry']['location']
it is
$result = array(
'results'=> array(
array(
'geometry' => array(
'location' => 'SOME VALUE'
)
)
)
)
You can use var_dump
and / or print_r
to view the structure of an array.
<?php
$result['results'][0]['geometry']['location'] = 1;
echo "<pre>";
var_dump($result);
print_r($result);
echo "</pre>";
?>
Outputs
array(1) {
["results"]=>
array(1) {
[0]=>
array(1) {
["geometry"]=>
array(1) {
["location"]=>
int(1)
}
}
}
}
Array
(
[results] => Array
(
[0] => Array
(
[geometry] => Array
(
[location] => 1
)
)
)
)