Hi,
I am trying to make sure that a string contains only letters, and no other characters.
I am using:
function checkletters($string) {
if (!preg_match($string, "^([a-z]|[A-Z])*$")) {
return true;
} else {
return false;
}
}
I am getting this error:
"Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in /path/to/file.php on line 47"
Line 47 is the one that contains "if (!preg_match($string, "^([a-z]|[A-Z])*$")) {", so I know there is something wrong with my reg exp.
Question: am I doing this the 'right way' or is there a string function that I should use instead?
THANKS
I am trying to make sure that a string contains only letters, and no other characters.
I am using:
function checkletters($string) {
if (!preg_match($string, "^([a-z]|[A-Z])*$")) {
return true;
} else {
return false;
}
}
I am getting this error:
"Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in /path/to/file.php on line 47"
Line 47 is the one that contains "if (!preg_match($string, "^([a-z]|[A-Z])*$")) {", so I know there is something wrong with my reg exp.
Question: am I doing this the 'right way' or is there a string function that I should use instead?
THANKS