Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CharacterReference.php

function 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.

1 call to CharacterReference::lookupName()
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 28

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;
}
RSS feed
Powered by Drupal