i have this long form that requires multiple inputs, how can i properly insert these inputs into an array using a foreach loop?
assuming i have these:
$name = $_POST['name'];
$color = $_POST['color'];
$age= $_POST['age'];
$gender = $_POST['gender'];
$location = $_POST['location'];
...etc..
instead of typing such this..
$myarray = array('id'=>$id,'name'=>$name,'color'=>$color,'age'=>$age,'gender'=>$gender,'location'=>$location,etc...);
how can i let foreach
loop insert the appropriate values into the array?