You are here

public static function CharacterReference::lookupName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/src/HTML5/Parser/CharacterReference.php \Masterminds\HTML5\Parser\CharacterReference::lookupName()

Given a name (e.g. 'amp'), lookup the UTF-8 character ('&')

Parameters

string $name: The name to look up.

Return value

string The character sequence. In UTF-8 this may be more than one byte.

2 calls to CharacterReference::lookupName()
CharacterReferenceTest::testLookupName in vendor/masterminds/html5/test/HTML5/Parser/CharacterReferenceTest.php
Tokenizer::decodeCharacterReference in vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php
Decode a character reference and return the string.

File

vendor/masterminds/html5/src/HTML5/Parser/CharacterReference.php, line 30

Class

CharacterReference
Manage entity references.

Namespace

Masterminds\HTML5\Parser

Code

public static function lookupName($name) {

  // Do we really want to return NULL here? or FFFD
  return isset(Entities::$byName[$name]) ? Entities::$byName[$name] : null;
}