开发者

php recive array from get form

how can i recive an array from an html get form?

i would receive the value of same checkbox, they have all the s开发者_如何学编程ame name "es. object"


In your HTML form, use something like this.

<input type="checkbox" name="object[]" />
<input type="checkbox" name="object[]" />
<input type="checkbox" name="object[]" />

Then when you receive it in PHP the values of the checkboxes will be held in the array $object.


Not sure I'm completely understanding your question but if you name your elements in the following way they will become ad array:

<input type="checkbox" name="lang[ ]" value="en">English<br />
<input type="checkbox" name="lang[ ]" value="fr">Français<br />
<input type="checkbox" name="lang[ ]" value="es">Español<br />


PHP puts all data received from a get form into the array $_GET

Put this on your page

print_r($_GET);

misunderstood the question

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜