Requests_IDNAEncoder::encode

Advertisement

Summery Summery

Encode a hostname using Punycode

Syntax Syntax

Requests_IDNAEncoder::encode( string $string )

Parameters Parameters

$string

(Required) Hostname

Return Return

(string) Punycode-encoded hostname

Source Source

File: wp-includes/Requests/IDNAEncoder.php

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

Advertisement

Advertisement

Leave a Reply