array post $_POST multiple values []
Multiple values in GET/POST: "variable[]"
To receive multiple values in an array, PHP understands the <select multiple="multiple" name="variable[]">...</select>
syntax and converts the submitted values to an array that you can reach through $_POST['variable']
(see the related faq).
As clonefish was planned to be universal, it also has this feature built-in: depending on the element names in the configuration array, it finds out, if the value of the element was meant to be an array.
The latest version of clonefish also identifies multidimensional arrays
(eg. <select name="variable[1][]" multiple="multiple">
).
Naturally, when using $clonefish->getElementValues()
to get all
the submitted values, you'll find that there's a value "variable[1]" which is an array (the brackets in "variable[1]" are treated literally, as part of the name).
form validation for developers!
clonefish is a proven, mature form generator class that helps PHP developers to create, validate and process secure, flexible and easy-to-maintain formslearn more