I have the following:
Array ( [0] => Array ( [0] => Array ( [value] => 150109 [format] => [safe_value] => 150109 ) ) )
I need to get the value "150109", but how on earth do I accomplish that?
I have the following:
Array ( [0] => Array ( [0] => Array ( [value] => 150109 [format] => [safe_value] => 150109 ) ) )
I need to get the value "150109", but how on earth do I accomplish that?
Top level:
print_r($data);
// Output: Array ( [0] => Array ( [0] => Array ( [value] => 150109 [format] => [safe_value] => 150109 ) ) )
Outmost element:
print_r($data[0]);
// Output: Array ( [0] => Array ( [value] => 150109 [format] => [safe_value] => 150109 ) )
Next level:
print_r($data[0][0]);
// Output: Array ( [value] => 150109 [format] => [safe_value] => 150109 )
The final value
echo $data[0][0]['value'];
// Output: 150109
Accessing each layer of values this way makes it easier to figure out how to get to your desired value. After a while this becomes more obvious.
You can use get values of arrays continusly on multidimensional arrays:
$value = $array[0][0]["value"];