php foreach multidimensional array recursive

39

function process($array) {
    foreach ($array as $key=>$value) {
        // Process the content of the array
    }
    if (isset($array[8])) // If we have linked arrays
        foreach($array[8] as $subArray)
            process($subArray);
}

Comments

Submit
0 Comments