Voting

: max(four, four)?
(Example: nine)

The Note You're Voting On

php at genjo dot fr
10 years ago
I use RecursiveIteratorIterator with parameter CATCH_GET_CHILD to iterate on leafs AND nodes instead of array_walk_recursive function :

<?php
// Iteration on leafs AND nodes
foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($candidate), RecursiveIteratorIterator::CATCH_GET_CHILD) as $key => $value) {
echo
'My node ' . $key . ' with value ' . $value . PHP_EOL;
}
?>

<< Back to user notes page

To Top