i am trying to print an array and below is my code:
Array
(
[148] => Array
(
[school] => Array
(
[adult high school] => 1
)
[noSchool] => Array
(
[adult high school] => 3
)
)
)
here is what i hope my below foreach can print out.
id school noSchool
148 1 3
here is my foreach loop:
foreach($schools as $id =>$sch )
{
foreach($sch as $name=>$number)
{
foreach($number as $nom => $n)
{
print $id.'==>'.$name.'==>'.$nom.'==>'.$n;
}
}
}
but the foreach above prints this instead:
148==>school==>adult high school ==>1
148==>no School==>adult high school ==>3
how can i achieve this:
id school noSchool
148 1 3
not this:
148==>school==>adult high school ==>1
148==>no School==>adult high school ==>3
so i basically want to focus on printing
148==>1==>3
thanks