WpOrg\Requests

IdnaEncoder::is_ascii()protected staticWP 1.0

Check whether a given text string contains only ASCII characters

Method of the class: IdnaEncoder{}

No Hooks.

Return

true|false. Is the text string ASCII-only?

Usage

$result = IdnaEncoder::is_ascii( $text );
$text(string) (required)
Text to examine.

IdnaEncoder::is_ascii() code WP 6.6.2

protected static function is_ascii($text) {
	return (preg_match('/(?:[^\x00-\x7F])/', $text) !== 1);
}