开发者

Detect and filter user input depending on charset

I am trying to filter user input depending on their charset. I am displaying keywords from user inputs to other users but to not want to display e.g. arabic or chinese characters but only english/latin characters.

How can I do that with PHP? Is there a easy solution o开发者_开发百科n doing this?

Thanks.


Use the mb_detect_encoding function to detect the charset.

This requires the Mbstring extension to be active in PHP, which it is on most servers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜