UTF-8 validation in PHP without using preg_match()

后端 未结 5 660
梦如初夏
梦如初夏 2021-01-01 01:43

I need to validate some user input that is encoded in UTF-8. Many have recommended using the following code:

preg_match(\'/\\A(
     [\\x09\\x0A\\x0D\\x20-\\         


        
5条回答
  •  别那么骄傲
    2021-01-01 02:32

    Have you tried ereg() instead of preg_match? Perhaps this one doesn't have that bug, and you don't need a potentially buggy workaround.

提交回复
热议问题