How can I validate a string and accept only letters with or without accents and spaces? I read a bit about ctype_alpha
, but it did not work with accented letters, even though I have set the configs to pt_br
:
setlocale(LC_ALL, 'pt_BR', 'pt_BR.UTF-8', 'pt_BR.UTF-8', 'portuguese');