i want each of the arrays inside an array to be displayed inside an li such that 3 sub-arrays have 3 <ul>'s. However, the second and third value of each sub-array has to be inside the same <li>. like this:
natraj :
HB : Rs.10,
HH : Rs.12
I used a for loop where the output is comin like this:
Natraj
HB
10
HH
12
and so on for other sub-arrays too. Please give a code similar to the one i used so i can understand this better. The code i used is:
<?php
$pencils = array( array("Natraj", "HB", 10, "HH", 12), array("Apsara", "HB", 8, "HH", 9), array("Camlin", "HB", 11, "HH", 13) );
//natraj :
//HB : Rs.10,
//HH : Rs.12
for ($pencilSet=0; $pencilSet<3; $pencilSet++){
//echo $pencils[$pencilSet];
echo "<ul>";
//echo "<strong>", $pencils[$pencilSet], "</strong>";
for($pencilSetDetials=0; $pencilSetDetials<5; $pencilSetDetials++){
echo "<li>",$pencils[$pencilSet][$pencilSetDetials], "</li>";
}
echo "</ul>";
?>
Thanks in advance