I use preg_match('/[a-z]+[0-9]/', strtolower($_POST['value'])) for check that the string contains both letters and numbers. How can I change so it just allow 5 ~ 15 characters?
/[a-z]+[0-9]{5,15}/ doesn't work.
UPDATE Now I tried:
if(preg_match('/^[a-z0-9]{5,15}$/', strtolower($_POST['value']))) {
echo 'Valid!';
}
else {
echo 'NOOOOO!!!';
}
If I type "dfgdfgdfg" in the input field it will say "Valid!". The value has to have both letters and numbers, and between 5-15 characters.