I have following array construction: $array[$certain_key][some_text_value]
And in a while loop (reading from db) I want to print the data from the array, where $row['db_id'] = $certain_key
.
So, I did not figure out how to do this with the php.net explanation of looping through multidimensional arrays:
foreach ($a as $v1) {
foreach ($v1 as $v2) {
echo "$v2\n";
}
}
...as I do not want to loop the whole array each time, but only when $certain_key is matched...
Hope it was clear enough. Thank you for every help!
EDIT: to me more exact, I hope... this is what I try to do:
$array[$array_key][some_text];
while reading from db {
//print array where $db_id = $array_key
}