Multidimensional Array Validation |
Hi everyone, I need some help with Form_validation library.
I need to ensure posted data has one valid url. The post structure is Code: { I need to validate this data and asure all emails have a valid email address format. I tried this Code: foreach ($data["emails"] as $key => $email) and this Code: $this->form_validation->set_rules(array("field" => "emails[]['address']", "label" => "email", "rules" => "valid_email"); But none of these options works, Any help will be welcome. Thanks in advance.
so this is one way of doing it, note that you are just doing the name of the field, not its form value
PHP Code: $therules = array( so in the rules array its the form field name, the label to show if the field does not validate, and the actual validation rules |
Welcome Guest, Not a member yet? Register Sign In |