Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $chr_en = "a-zA-Z0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
- if (preg_match("/^[$chr_en]+$/", $string)) {
- // TRUE
- } else {
- // FALSE
- }
- $string = 'Â english'; // FALSE
- $string = '!english 123'; // TRUE
- $string = 'en + рус'; // FALSE
- $chr_en = "a-zA-Z0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
- if (preg_match("/^[$chr_en]+$/", $string)) {
- $chr_ru = "А-Яа-яЁё0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
- if (preg_match("/^[$chr_ru]+$/u", $string)) {
- $chr_ru_en = "A-Za-zА-Яа-яЁё0-9s`~!@#$%^&*()_+-={}|:;<>?,./"'\[]";
- if (preg_match("/^[$chr_ru_en]+$/u", $string)) {
Add Comment
Please, Sign In to add comment