Page 1 of 1

HTML Form Arrays

Posted: Tue Jan 27, 2004 4:02 pm
by bg
How do you use form arrays that have been passed via GET?

For example, I have an array on the form arr_property_type[] (defined as such in the input tag) consisting of check boxes.

Does php treat $_GET['arr_property_type'] as an array, or is there something special you need to do? Thanks,

Brian

Posted: Tue Jan 27, 2004 4:18 pm
by markl999
Does php treat $_GET['arr_property_type'] as an array
Yep, same as POST.

Posted: Tue Jan 27, 2004 4:21 pm
by DuFF

Code: Select all

<?php
foreach($_GET['checkbox'] as $value) {
    echo "You clicked a checkbox with the value: " . $value"<br />\n";
}
?>