How do I do that?
Much appreciated.
EDIT: Ok, I figured it out. This particular script will look for either a name with one space or two spaces and will return TRUE only if each part contains letters of either case.
- John Smith or John von Smith.
Code: Select all
$name_with_one_space = "/^\b[a-zA-Z]+\b\s\b[a-zA-Z]+\b$/";
$name_with_two_spaces = "/^\b[a-zA-Z]+\b\s\b[a-zA-Z]+\b\s\b[a-zA-Z]+\b$/";
if ((preg_match($name_with_one_space, $name)) or (preg_match($name_with_two_spaces, $name)))
{
echo "+ A match was found.";
} else {
echo "- A match was not found.";
}Thanks!