Check whether a given text string contains only ASCII characters
Parameters
$text
stringrequired- Text to examine.
Source
protected static function is_ascii($text) {
return (preg_match('/(?:[^\x00-\x7F])/', $text) !== 1);
}
Check whether a given text string contains only ASCII characters
$text
stringrequiredprotected static function is_ascii($text) {
return (preg_match('/(?:[^\x00-\x7F])/', $text) !== 1);
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.