Multiple form Submissions
'. $user; Echo '
'. $addtime;? >
My code is this, a form, it needs to add more than two, there may be 5, 10, 20 such a one, but if I put
Reply to discussion (solution)
It should be done with arrays,
Not tested.
Yes, with an array.
Yes, yes, support charm, used once before, that's how it's done.
Of course it's an array.
Thank you, but this place of PHP how to write, I wrote my own after the submission of only one array
$title =$_post[' title ';
$user =$_post[' user '];
$note =$_post[' note '];
Echo ';
Print_r ($title);
Echo '
'. Print_r ($user);
Echo '
'. $note;
?>
===============
How do you change to an array like this?
$st =array (' Xiao Li ', ' 19 ', ' language '), array (' Wang Qiang ', ' 20 ', ' math '), Array (' Zhang Wanglei ', ' 29 ', ' actor '), Array (' Hukolin ', ' 27 ', ' Piano Teacher '));
Multiple form Submissions
';p rint_r ($title); Echo '
'. Print_r ($user); Echo '
'. Print_r ($note); Echo '
';? >
My code is like this, but why do I have more than 1 when I lose it?
And I'm here. After the default is three one-dimensional array, how to make a two-dimensional array, whether it is necessary to submit the form there set it.
I want the two-dimensional array to look like this.
$st =array (' first title ', ' admin ', ' 13-05-15 '), Array (' second title ', ' Zhansan ', ' Zhagnsan '), Array (' latest message ', ' Lisa ', ' note '), Array (' Pegasus ', ' Malaysia ', ' other Notes ') );
The array to which the page was submitted is organized.
$out = Array (), foreach ($_post as $key + $value) {foreach ($value as $k + = $v) {$out [$k] [] = $value [$k]}}
Not one more, but two more! The second Array does not have a 1 in front of it?
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);