daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jul 22nd, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $chr_en = "a-zA-Z0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
  2. if (preg_match("/^[$chr_en]+$/", $string)) {
  3.     //  TRUE
  4. } else {
  5.     //  FALSE
  6. }
  7.    
  8. $string = 'Â english';      //  FALSE
  9. $string = '!english 123';   //  TRUE
  10. $string = 'en + рус';       //  FALSE
  11.    
  12. $chr_en = "a-zA-Z0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
  13. if (preg_match("/^[$chr_en]+$/", $string)) {
  14.    
  15. $chr_ru = "А-Яа-яЁё0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
  16. if (preg_match("/^[$chr_ru]+$/u", $string)) {
  17.    
  18. $chr_ru_en = "A-Za-zА-Яа-яЁё0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
  19. if (preg_match("/^[$chr_ru_en]+$/u", $string)) {
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top