PHP: How do I detect if an input string is Arabic

后端 未结 10 1395
旧时难觅i
旧时难觅i 2020-12-08 08:34

Is there a way to detect the language of the data being entered via the input field?

10条回答
  •  天涯浪人
    2020-12-08 09:01

    I assume you're referring to a Unicode string... in which case, just look for the presence of any character with a code between U+0600–U+06FF (1536–1791) in the string.

提交回复
热议问题