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)


Top ↑

Return

(bool) Is the string ASCII-only?


Top ↑

Source

File: wp-includes/Requests/IDNAEncoder.php

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.