PHP foreach loop through multidimensional array
Posted
by Muiter
on Stack Overflow
See other posts from Stack Overflow
or by Muiter
Published on 2010-05-06T19:23:00Z
Indexed on
2010/05/06
19:28 UTC
Read the original article
Hit count: 316
I have an multidimensional array, how can I use it? I want to use each seperate array in an for loop.
I have this code
<?php
foreach ($calculatie_id[$i] as $value)
{
echo $value;
}
?>
print_r($calculatie_id); gives Array ( [0] => Array ( [0] => 4 [1] => 6 ) [1] => Array ( [0] => 1 [1] => 5 ) [2] => Array ( [0] => 5 [1] => 6 ) [3] => )
But when using the foreach I only get 46
© Stack Overflow or respective owner