views:

43

answers:

1

Hi,

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 on doing this?

Thanks.

+1  A: 

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.

Emil Vikström