I am selecting checkboxes and want to save in an associative array with current page number $_GET['page_no']
as it's index, but only 1 value goes in, why no other?
$pageno = $_GET['page_no']; //Say page no is 1
$_SESSION['selected_vals'] = array();
foreach($_POST['record_num'] as $throw_rec_nums) {
$_SESSION['selected_vals'][$pageno] = $throw_rec_nums;
}
What I expect
$_SESSOION['selected_val'] (
[1] => 24
[1] => 46
[1] => 56
)
But I only get 24 even if 3 checkboxes are selected
Note: $_GET['page_no'] is returned as array