<? PHP $ arr = Array ( Array (76,87,68), Array (65,89,95), Array (90,80,66), Array (90,95,65), 5,234,56, 'the Hello '); // define a two-dimensional array function ergodic ( $ ARR ) { // definition of the function to iterate the foreach ( $ ARR AS $ K => $ V ) { IF ( is_array ( $ V )) { echo "<br /> array elements { $ K } of elements: <br /> " ; ergodic ( $ V ); // recursive call echo '<br />' ; } the else { echo "{ $ K } => { $ V } <br />" ; } } } ergodic ( $ ARR ); // call the function through the array ?>