I use this code to check if a string is in English or not.
<?php $string="γ§ζΈγγΏγγγ€γγ³γ (γ"; if(!preg_match('/[^\W_ ] /',$string)) { echo "Please enter English words only:("; } else { echo "OK, English Detected!"; } ?>
It cannot provide the perfect result, because a line like "some english text γ§ζΈγγΏγγγ€γγ³γ (γ" also defines English as any idea?
source share