I have an array of integer like this $someVar = array(1,2,3,4,5)
. I need to validate $someVar
to make sure every element is numeric.How can I do that?
I know that for the case of a single valued variable, the validation rule would be something like this $rules = array('someVar'=>'required|numeric')
. How can I apply the same rule to every element of the array $someVar
?
Thanks a lot for helping.