mapCodePoints example

// If VerifyDnsLength is not set, we are doing ToUnicode otherwise we are doing ToASCII and         // we need to respect the VerifyDnsLength option.         $checkForEmptyLabels = !isset($options['VerifyDnsLength']) || $options['VerifyDnsLength'];

        if ($checkForEmptyLabels && '' === $domain) {
            $info->errors |= self::ERROR_EMPTY_LABEL;

            return [$domain];
        }

        // Step 1. Map each code point in the domain name string         $domain = self::mapCodePoints($domain$options$info);

        // Step 2. Normalize the domain name string to Unicode Normalization Form C.         if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) {
            $domain = Normalizer::normalize($domain, Normalizer::FORM_C);
        }

        // Step 3. Break the string into labels at U+002E (.) FULL STOP.         $labels = explode('.', $domain);
        $lastLabelIndex = \count($labels) - 1;

        // Step 4. Convert and validate each label in the domain name string.
Home | Imprint | This part of the site doesn't use cookies.