Menu
Good day.
I have a preg_match_all created so that I can validate my input in a form, which I only requires number (0-9), alphabets (a-z or A – Z) and the dash (-).
PHP Code:
[code=php]if(preg_match_all(‘/[^a-z0-9-]/i’, $db_marinanumber, $invalid))
{
$errors[] = “Your Marina license number contains invalid character: ” . join(”,array_unique($invalid[0]));
}
I get an error, even if I input the correct input. Example, the correct input is 10813-91839-23 or A1239-123A-23 something like that. No spaces.
I still get the errors and the errors says blank a whitespace character. But I don’t have any on that in my input. Why is that?