I’m trying to echo out all variables of two arrays with a single foreach loop making a url. Some coding examples will be honored.
I have this so far :
<?php
foreach($menu_names as $menu_name){
echo "<li><a href='?subj= " .urlencode($subjects["id"]). " '>".$menu_name."</a></li>";
}
?>
I want to add one more array within this loop
assume you have the same number of items in those two arrays.
if you want to use
foreach(), then the arrays need to have the same index:if the arrays have numeric index, you can just use
for():