How does html-php obtain multiple input values with the same name on the page?

Source: Internet
Author: User
Html code: {code...} php code: {code...} I can only get the first one. How can I obtain all the html code submitted using a form:

Php code:

$imgs = $_FILES['imgs'];

In this case, I can only get the first one. How can I obtain all the information I submitted using a form?

Reply content:

Html code:

Php code:

$imgs = $_FILES['imgs'];

In this case, I can only get the first one. How can I obtain all the information I submitted using a form?

`

foreach($_FILES['imgs']['name'] as $key => $row ){    echo $_FILES['imgs']['name'][$key];}

`

Use the following method:


  
   dump(trim($_POST['imgs1']));dump(trim($_POST['imgs2']));dump(trim($_POST['imgs3']));
  

The method on the first floor is OK! Pass it as an array to the background and process it!

Upload with Ajax, directly return the front-end image url... and put it in the input box

Front end:
Backend:print_r($_POST["imgs"]);

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.