1
How can I validate a string and accept only letters with or without accent and spaces? I read a little about the ctype_alpha
, but it didn’t work with accented lyrics, although I set the configs to pt_br
:
setlocale(LC_ALL, 'pt_BR', 'pt_BR.UTF-8', 'pt_BR.UTF-8', 'portuguese');
Thank you, I didn’t know !!
– Thiago
UTF-8 is the best "filter"? I did some tests and sometimes it doesn’t pass, when I remove the "u" it gets ?? in the accents, but it works
– Thiago
@NGTHM4R3 I think it is relative. What words for example do not pass the test?
– stderr
Like, actually something strange is happening, I test my form by sending the requests without filling out the form, so it makes a mistake, but when I send the data of the form itself it accepts the validation, what will it be? and something from html "charset"?
– Thiago
@NGTHM4R3 Would it not be more appropriate to use the
isset
before checking whether the variable has been defined?– stderr
Yes, it is already properly "handled", is that as my form is also validated by jquery, it is more practical to test already sending a request ready, but the normal use is by the same form.
– Thiago
How can I add numbers to this validation?
– Thiago