I would like to validate a string with a pattern that can only contain letters (including letters with accents). Here is the code I use and it always returns "nok". I don't know what I am doing wrong, can you help? thanks
$string = 'é';
if(preg_match('/^[p{L}]+$/i', $string)){
echo 'ok';
} else{
echo 'nok';
}
See Question&Answers more detail:os