Skip to content

Instantly share code, notes, and snippets.

@almino
Forked from commix/gist:1287276
Last active November 26, 2017 04:07
Show Gist options
  • Save almino/eb4bd752b0ca580d9d6c to your computer and use it in GitHub Desktop.
Save almino/eb4bd752b0ca580d9d6c to your computer and use it in GitHub Desktop.
PHP: Validate - Human Name
/**
* Validate a Human Name
*
* @param $name
* A name as a string.
* @return
* TRUE or FALSE if name is a valid human name.
*/
function valid_human_name($name) {
# Matches names like "Ítalo", "Édith"
return (bool) preg_match("/^\p{Lu}[\p{L} '&-]*[\p{L}]$/u", $name);
}
@desicochrane
Copy link

What about asian names? 김민경 for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment