Can anyone explain, how this cat array is getting the id and name?
foreach ($all_categories as $menu) { ?>
<input type="checkbox" id="cat_<?php echo $menu->id; ?>" value="<?php echo $menu->id.'_'.$menu->name; ?>" name="cat[]">
..
..
}
and i can get the id and name in controller,by using like below. It is working totally fine. My question is, how id
went to cat array
in position 0,and name position 1?
$res_arr=explode('_',$value);
$cat_id=$res_arr[0];
$cat_name=$res_arr[1];