I am populating a multidemensional array and I don’t know what going into it, but I’m trying to access the data. Basicly this is what I have.
while (some condition) {
$data[] = $stuff;
}
Then I am trying to access it like this.
for ($i = 0; $i < count($data); $i++) {
foreach ($data[$i] as $key => $value) {
echo $key . " => " . $value;
}
}
But it is not working, which is why I am here asking.
I have also tried storing $data[$i] into a temp array and looping it, but it fails as well.
1 Answer