IdnaEncoder::is_ascii( string $text ): bool

In this article

Check whether a given text string contains only ASCII characters

Parameters

$textstringrequired
Text to examine.

Return

bool Is the text string ASCII-only?

Source

protected 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.