I have two forms, if $_POST['submit'] of the first form is click the second form is loaded and an array is assigned with $POST data of first form , else if the $_POST['submit'] of the second form is pressed the same array needs to have additional elements this time from $POST of second form, but the problem is that my array is getting empty as soon as the elseif is executed. I tried passing the array by reference but that did not help me.
if(isset(btn_Of_Form1)) {
echo "form2"; $my_arr =$_POST;
}
elseif(btn_of_Form2){
$my_arr =array_merge($my_arr,$_POST);
}
You can use
$_SESSIONandserialize: