I want to use a code like
foreach($_POST[cat_id] as $key=>$val){
if($val){
$arr[cat_id] = $val;
$arr[porder] = $_POST['".$val."'];
$arr[store_user_id] =$_SESSION[uid];
}
}
but $_POST['".$val."']
will not cover any value but in my loop put the name dynamically can any one help me I want to show value of $_POST['".$val."']
which comes dynamically. I also use $_POST['<?=$val?>']
but it does not work.. please help...
Just use $_POST[$val]
in place of $_POST['".$val."']
have you tried this way:
$arr[cat_id] = $_POST[$val]
?