Hi I have this code here:
public function length($args) {
if (isset($this->length)) {
foreach ($this->length as $k => $v) {
if (strlen($args[$k])>=$v[0] && strlen($args[$k])<$v[1]) {
return true;
} else {
array_push($this->form_errors, $v[2]);
return false;
}
}
} else {
return true;
}
}
I'm not sure why but its not working as expected. The foreach loop only loops through one of the $args[$k] even though there are 2 of them. Anyone have any idea whats going on? I'm writing this question in a hurry so if I need to explain anything else, please let me know.
Thanks!