cphalcon
cphalcon copied to clipboard
[NFR] Applying a filter to array
There is a situation in which we may need to apply one or more filters to an array. A common use case will be a submission of a form with checkboxes.
<input type="checkbox" name="emails[]" value="[email protected]">
<input type="checkbox" name="emails[]" value="[email protected]">
<input type="checkbox" name="emails[]" value="[email protected]">
Currently, it seems that the only way to sanitize the $_POST['emails'] is by looping and applying a filter to each value of the array. It will be much more convenient if that could be done with one line of code as is done with strings.
$email = $request->getPost("emails", "email");
+1
It's a good feature.
This is now supported in 0.9.0