Requests_IDNAEncoder::is_ascii() WordPress Method
The Requests_IDNAEncoder::is_ascii() method is used to determine whether a given string is ASCII-only. This is important for IDNA, as only ASCII characters are allowed.
Requests_IDNAEncoder::is_ascii( string $string ) #
Check whether a given string contains only ASCII characters
Parameters
- $string
(string)(Required)
Return
(bool) Is the string ASCII-only?
Source
File: wp-includes/Requests/IDNAEncoder.php
protected static function is_ascii($string) { return (preg_match('/(?:[^\x00-\x7F])/', $string) !== 1); }
Expand full source codeCollapse full source codeView on TracView on GitHub