Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Character '¿' in regex

I'm trying to let put in the validator the ¿ character ('cause of my language), but when I set it with/without escaping (\¿ or ¿), I can send the char º to the regex and returns that it is valid (so I cannot include it in the regex). Anyone had this issue before?



32.7k

use /u option for UTF-8

    preg_match('/¿/u')


18.5k
Accepted
answer