101-PHP two-dimensional array of elements of three outputs, a function package

<? 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 
?>

 

Guess you like

Origin www.cnblogs.com/tianpan2019/p/11001663.html