lookupDecimal example

             // Decimal encoding.             // [0-9]+;             else {
                // Convert from decimal to char.                 $numeric = $this->scanner->getNumeric();
                if (false === $numeric) {
                    $this->parseError('Expected &#DIGITS;, got &#%s', $tok);
                    $this->scanner->unconsume(2);

                    return '&';
                }
                $entity = CharacterReference::lookupDecimal($numeric);
            }
        } elseif ('=' === $tok && $inAttribute) {
            return '&';
        } else { // String entity.             // Attempt to consume a string up to a ';'.             // [a-zA-Z0-9]+;             $cname = $this->scanner->getAsciiAlphaNum();
            $entity = CharacterReference::lookupName($cname);

            // When no entity is found provide the name of the unmatched string             // and continue on as the & is not part of an entity. The & will


    /** * Given a hexidecimal number, return the UTF-8 character. * * @param $hexdec * * @return false|string|string[]|null */
    public static function lookupHex($hexdec)
    {
        return static::lookupDecimal(hexdec($hexdec));
    }
}
Home | Imprint | This part of the site doesn't use cookies.