For PHP's first attempt to obtain the POST parameter, I would like to ask, my front-end html, the data submitted with get, the address bar is like this:
.../... & A = good_1 & B = 200 & a = good_2 & B = 300 & a = good_4 & B = 400
Use $ _ GET to GET the parameter value in the PHP file, and use foreach ($ _ REQUEST as $ key => $ value)
But only the last one can be obtained, that is, a = good_4 & B = 400. The other two cannot be obtained. how can this problem be solved?
Reply to discussion (solution)
Your key already exists.
Because the url parameter string violates the php convention (the input variable with the same name must be in the array format ),
You can parse it from $ _ SERVER ['query _ string ']
This is not a duplicate key.
.... /.. & A [] = good_1 & B [] = 200 & a [] = good_2 & B [] = 300 & a [] = good_4 & B [] = 400
In this way, the value can be obtained.
Your key already exists.
Your parameter fields except a and B are already repeated.
The parameter already exists.
If the parameter names are repeated, they will be overwritten.
& A = good_1 & B = 200 & a = good_2 & B = 300 & a = good_4 & B = 400
The parameters are repeated and will be overwritten. You can use an array or change the parameter name.
For example:
& A [] = good_1 & B [] = 200 & a [] = good_2 & B [] = 300 & a [] = good_4 & B [] = 400
Array( [0] => good_1 [1] => good_2 [2] => good_4)Array( [0] => 200 [1] => 300 [2] => 400)
Because the url parameter string violates the php convention (the input variable with the same name must be in the array format ),
You can parse it from $ _ SERVER ['query _ string ']
The moderator is so fine as he knows php ???