Adding With SA
your problem is with foreach loop:
first I hope that you understand php array exactly as it is. now:
there is two way of writing foreach statement
1.
foreach (array_expression as $value)
statement
2
foreach (array_expression as $key => $value)
statement
in case of 1:
take an example:
$arr['number_one']='me';
$arr[2]='you';
$arr[5]='him';
foreach($arr as $value){
echo $value."\n";
}
foreach($arr as $key => $value){
echo $key." => ".$value."\n";
}