PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to create input validation that would pass only characters and white-spaces.
This is where I am. Though I can't use [a-zA-Z] because input also might be kiliric, Baltic alphabet (eg. ?????Š??Ž, etc) or Asian etc.
Any ideas?
I've never used this filter_var(...) but with the normal preg-functions, '/\p{L}/' will match any string containing a letter. Matching a string only when it solely consists of letters would be done like this: '/^\p{L}+$/'
^ denotes the start of the string, $ is the end of the string and + means "one or more".