I am trying to do form validation but when I try to print out the contents of an array when there is an error it doesnt output anything.
$errors = array();
if (strlen($password) >= 6) {
array_push($errors, "Your password is not long enough! Must be over 6 characters!");
}
if(count($errors) !== 0) {
...
} else {
echo "There is errors<br/>";
foreach($errors as $er){
echo $er . "<br/>";
}
}
What I do get is "There is errors" so I know that the if else is working.