PHP Class Contao\Idna

The class encodes and decodes internationalized domain names according to RFC 3490. It also contains two helper methods to encode e-mails and URLs. Usage: echo Idna::encode('bürger.de'); echo Idna::encodeEmail('mit@bürger.de'); echo Idna::encodeUrl('http://www.bürger.de');
显示文件 Open project: contao/core-bundle Class Usage Examples

Public Methods

Method Description
decode ( string $strDomain ) : string Decode an internationalized domain name
decodeEmail ( string $strEmail ) : string Decode the domain in an e-mail address
encode ( string $strDomain ) : string Encode an internationalized domain name
encodeEmail ( string $strEmail ) : string Encode the domain in an e-mail address
encodeUrl ( string $strUrl ) : string Encode the domain in an URL

Method Details

decode() public static method

Decode an internationalized domain name
public static decode ( string $strDomain ) : string
$strDomain string The domain name
return string The decoded domain name

decodeEmail() public static method

Decode the domain in an e-mail address
public static decodeEmail ( string $strEmail ) : string
$strEmail string The e-mail address
return string The decoded e-mail address

encode() public static method

Encode an internationalized domain name
public static encode ( string $strDomain ) : string
$strDomain string The domain name
return string The encoded domain name

encodeEmail() public static method

Encode the domain in an e-mail address
public static encodeEmail ( string $strEmail ) : string
$strEmail string The e-mail address
return string The encoded e-mail address

encodeUrl() public static method

Encode the domain in an URL
public static encodeUrl ( string $strUrl ) : string
$strUrl string The URL
return string The encoded URL