PHP Documentation if ( !\defined( 'IDNA_NONTRANSITIONAL_TO_ASCII' ) ) { \define( 'IDNA_NONTRANSITIONAL_TO_ASCII', 16 ); } if ( !\defined( 'INTL_IDNA_VARIANT_UTS46' ) ) { \define( 'INTL_IDNA_VARIANT_UTS46', 1 ); } function idn_to_ascii( $string, $flags = 0, $variant = 1, &$idna_info = null ) { $punycode = new \TrueBV\Punycode; try { return $punycode->encode( $string ); } catch ( \Exception $e ) { return $string; } }