Created
May 31, 2012 10:18
-
-
Save jmlweb/2842459 to your computer and use it in GitHub Desktop.
Ejemplo de validación para campos con array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//asumiendo que campo es un campo de formulario de tipo array | |
foreach($_POST as $k1 => $v1) { | |
if($k1 === 'campo' && is_array($v1)) { | |
foreach($campo as $k2 => $v2) { | |
$this->form_validation->set_rules('campo['.$k2.']', 'campo'.$k2, 'required'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment