Given the following array $testarray:
array(1) {
[0]=>
array(3) {
["brand"]=>
string(4) "fiat"
["year"]=>
string(4) "2001"
["color"]=>
string(4) "blue"
}
}
I'm trying to access the data inside with:
foreach($testarray[0] as $key => $value)
{
$newresultado = $value['brand'].$value['year'].$value['color'];
}
echo $newresultado;
I do not get an error returned, but I do get an empty string.
I checked a lot of topics and this should be correct. Why am I getting the empty string?
newresultadofirst.[0]from the foreach, you are iterating over the elements then looking for a brand.