Requests_IDNAEncoder::encode( string $string ): string

Encode a hostname using Punycode


Parameters

$string string Required
Hostname

Top ↑

Return

string Punycode-encoded hostname


Top ↑

Source

File: wp-includes/Requests/IDNAEncoder.php. View all references

public static function encode($string) {
	$parts = explode('.', $string);
	foreach ($parts as &$part) {
		$part = self::to_ascii($part);
	}
	return implode('.', $parts);
}


Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.