Multiple forms how does PHP receive post data?

Source: Internet
Author: User
 
  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);
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.