getHex example

return '&';
            }

            // Hexidecimal encoding.             // X[0-9a-fA-F]+;             // x[0-9a-fA-F]+;             if ('x' === $tok || 'X' === $tok) {
                $tok = $this->scanner->next(); // Consume x
                // Convert from hex code to char.                 $hex = $this->scanner->getHex();
                if (empty($hex)) {
                    $this->parseError('Expected &#xHEX;, got &#x%s', $tok);
                    // We unconsume because we don't know what parser rules might                     // be in effect for the remaining chars. For example. '&#>'                     // might result in a specific parsing rule inside of tag                     // contexts, while not inside of pcdata context.                     $this->scanner->unconsume(2);

                    return '&';
                }
                $entity = CharacterReference::lookupHex($hex);
            }
Home | Imprint | This part of the site doesn't use cookies.