I am trying to loop through a multi-diminsional array
and having a little problems.
====================================================
Example array :
$rub[1][1][5] = 50.1
$rub[1][2][6] = 52.5
$rub[1][3][7] = 54.3
===========================================
Example code looping through to get keys and value:
foreach($rub[1] as $k2){
foreach($k2 as $k3 => $value){
echo $k2."-".$k3."-".$value."<br>";
}
}
===========================================
Example ouptput I am getting:
Array-5-50.1
Array-6-52.5
Array-7-54.3
===========================================
What I expected to get:
1-5-50.1
2-6-52.5
3-7-54.3
===========================================
Any ideas what I am doing wrong here??
Thanks in advance ! ! !
=================================
Imagination is more important than knowledge.
(A.E.)
and having a little problems.
====================================================
Example array :
$rub[1][1][5] = 50.1
$rub[1][2][6] = 52.5
$rub[1][3][7] = 54.3
===========================================
Example code looping through to get keys and value:
foreach($rub[1] as $k2){
foreach($k2 as $k3 => $value){
echo $k2."-".$k3."-".$value."<br>";
}
}
===========================================
Example ouptput I am getting:
Array-5-50.1
Array-6-52.5
Array-7-54.3
===========================================
What I expected to get:
1-5-50.1
2-6-52.5
3-7-54.3
===========================================
Any ideas what I am doing wrong here??
Thanks in advance ! ! !
=================================
Imagination is more important than knowledge.
(A.E.)