This PHP code is an example program that demonstrates how to use nested foreach loops to unravel nested arrays.
<?php // Create an array of arrays of elements. $iaaArray = [ ["Matthew", "Mark", "Luke", "John"], ["Father", "Son", "Holy Ghost"], ["Wisdom", "Understanding", "Counsel", "Fortitude", "Knowledge", "Piety", "Fear of the Lord"], ["Faith", "Hope", "Charity"], ["Prudence", "Justice", "Fortitude", "Temperance"] ]; // Use nested foreach loops to unravel the nested arrays foreach ($iaaArray as $iaArray) { echo "<ul>"; foreach($iaArray as $iNumber) { echo "<li>".$iNumber."</li>"; } echo "</ul>"; } ?>
© 20072024 XoaX.net LLC. All rights reserved.