value1=2012251&value1=2012254&value2=531&value2=544
I thought that if you attach the data in the above way and throw it, it will overlap and you can get it as an array, but when I actually did it, I only got the last value. I've tried many ways to receive it as an array, but I haven't found it yet. How should I get the price?
$arrValue1 = $_POST["value1"]; $arrValue2 = $_POST["value2"];
echo $arrValue1 2012251
echo $arrValue2 544
php get http
Under
, such as html post, in name [ ], must be into a
.
Date 1:<input name="date[]" type="text"><br>
Date 2:<input name="date[]" type="text"><br>
Date 3:<input name="date[]" type="text"><br>
If you read it as below, you will receive it as an array.
$email = $_POST['date'];
If you pass multiple values with the same key value, the value is already an array.
You can do it as follows.
$value1s = $_POST['value1'];
$value2s = $_POST['value2'];
// Try each one as follows.
foreach($value1s as $value) {
print "Form value1 is ".$value."\n";
}
foreach($value2s as $value) {
print "Form value2 is ".$value."\n";
}
// If value1 and value2 have the same number and need to be approached together, write as follows.
foreach( $value1 as $key => $val ) {
print "Form value1 is "".$value"" and value2 is "".It is $value2s[$key].\n";
}
as above, for each the door, now available to view all the values.
© 2024 OneMinuteCode. All rights reserved.