How does php receive post data from multiple forms?
Multi-form submission
'. $ User; echo'
'. $ Addtime;?>
My code is like this. to add more than two entries to a form, there may be five, ten, and 20 entries.
Reply to discussion (solution)
It should be implemented using arrays,
Not tested ..
Yes. use an array.
Well, this is how it works to support charm. it was used once before.
Of course, it's an array.
Thank you, but how did PHP write this? I wrote only one array after submission.
$ Title = $ _ POST ['title'];
$ User = $ _ POST ['user'];
$ Note = $ _ POST ['note'];
Echo '';
Print_r ($ title );
Echo'
'. Print_r ($ user );
Echo'
'. $ Note;
?>
====================
How can I change it to an array like this?
$ St = array ('Lil', '19', 'China'), array ('Wang Qiang ', '20', 'mat '), array ('Zhang Wanglei ', '29', 'actor'), array ('hu corline', '27', 'Piano instructor '));
Multi-form submission
'; Print_r ($ title); echo'
'. Print_r ($ user); echo'
'. Print_r ($ note); echo'
';?>
My code is like this, but why is one more output,
In addition, after submission, three one-dimensional arrays are used by default. how to create a two-dimensional array? do you need to set it in the submission form.
The two-dimensional array I want looks like this.
$ St = array ('First title', 'admin', '13-05-15 '), array ('second title', 'zhansan ', 'zhagnsan'), array ('latest message', 'Lisa ', 'note'), array ('Malaysia Airlines', 'Malaysia ', 'other description '));
Sort out the arrays submitted on the page
$out = array();foreach ($_POST as $key => $value) {foreach ($value as $k => $v) {$out[$k][] = $value[$k]}}
Not one more, but two more! Isn't there another 1 in front of the second Array?
Bool print_r (mixed expression [, bool return])
foreach($_POST['title'] as $k=>$v){ $ar[]=array($v,$_POST['user'][$k],$_POST['note'][$k]);}print_r($ar);