How do I bulk input data and execute it?

Source: Internet
Author: User
The great God, that's it, I'm going to pass a number of data to adc.php for execution; I know that a group of passes can be used in the following code way. But what if I want to pass a bunch of groups and don't need to manually set up a group of inputs?








For example, the following 5 sets of data, if divided into 5 times, the above program can, however, it is possible that I paste the following table into a text box at a time, and then the program is automatically recognized, and group-wise execution? Thank you, great God.
Xiao Wang 100
Xiao Zhang 121
Xiao Liu 541
Zhang 3,555
Lee 4,410


Reply to discussion (solution)

The idea should be that the array JSON passes the receive parsing foreach Loop

Yes, you can. Output a single box with a uniform delimiter separator number directly to PHP after explode a little bit or you can use String.splite () on the front end.

For example, you entered: Xiao Wang 100 Xiao Zhang 121 Xiao Liu 541 Zhang 3,555 Li 4,410 are separated by vacancies.
Front-end processing words

var str = ' Xiao Wang 100 Xiao Zhang 121 Xiao Liu 541 Zhang 3,555 Li 4,410 '; var = str.splite (""); var urlparam = "? A=1";//multiple pass a useless parameter to keep the data format convenient below Loop f or (var i = 0; i
   
  
The background is a name array and an scores array
Or you pass it directly to the backstage.
? data= Xiao Wang 100 Xiao Zhang 121 Xiao Liu 541 Zhang 3,555 Li 4,410
Background explode () it's possible to cycle according to a similar method as above.

Can be saved with textarea, one user at a line
Then PHP is interpreted according to the line break.

For example:
Html

   
 
           


server.php
 
    $name,            ' score ' = $score        );    }} Print_r ($result);? >


Enter in textarea
Xiao Wang, 100
Xiao Zhang, 121
Xiao Liu, 541
Zhang San, 555
John Doe, 410

After submission, PHP gets the
Array (    [0] = = Array        (            [name] + small Wang            [score] = +        )    [1] = = Array        (            [Name] = > Xiao Zhang            [score] = 121        )    [2] = = Array        (            [name] + Xiao Liu            [score] = 541        )    [3] = = Array        (            [Name] = Zhang San            [score] = 555        )    [4] = = Array        (            [name] = + John Doe            [score] = > 410)        )

Thank you to the great God to provide ideas and methods, I did not all learn, but I probably learned the 2 floor. Thank you.

  • 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.