I am having issue with execution of nested foreach loop execution for desired result. Below is the scenario:
Following are result in two arrays
Result1:
Array ( [0]=> Array ( [questionID] => 103 [answer] => Female [answer_cnt] => 8 )
[1] => Array ( [questionID] => 103 [answer] => Male [answer_cnt] => 9 )
)
Result2
Array ( [0] => Male [1] => Female )
my code using foreach loop is below
foreach($qrs as $qrow)
{ foreach($d as $q){
echo"<br>".$q;
echo $qrow['answer_cnt']."<br>";}
}
it will get output :
Male 8
Female8
Male 9
Female9
But My Expected output is
Female 8
Male 9