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.