I've the following array$_SESSION['survey_ans'][]=$records;
and will get the result withvar_dump($_SESSION['survey_ans']);
array(6) {
[0]=> array(1) {
[1]=> string(5) "vpoor"
}
[1]=> array(1) {
[10]=> string(4) "poor"
}
[2]=> array(1) {
[6]=> string(7) "average"
}
[3]=> array(1) {
[11]=> string(4) "good"
}
[4]=> array(1) {
[12]=> string(5) "vgood"
}
[5]=> array(1) {
[13]=> string(4) "good"
}
}
But when I run this
foreach($_SESSION['survey_ans'] as $key=>$value) {
echo $key."-".$value."<br />";
}
I will get the error "Notice : Array to string conversion in ". So how do I get the result as following?
1, vpoor
10, poor
6, average
11, good
12, vgood
13, good