Properties

$_entity_lookup

$_entity_lookup

Reference to entity lookup table.

$_textEntitiesRegex

$_textEntitiesRegex

Callback regex string for entities in text.

$_attrEntitiesRegex

$_attrEntitiesRegex

Callback regex string for entities in attributes.

$_semiOptionalPrefixRegex

$_semiOptionalPrefixRegex

Tests if the beginning of a string is a semi-optional regex

$_substituteEntitiesRegex

$_substituteEntitiesRegex

Callback regex string for parsing entities.

$_special_dec2str

$_special_dec2str

Decimal to parsed string conversion table for special entities.

$_special_ent2dec

$_special_ent2dec

Stripped entity names to decimal conversion table for special entities.

Methods

__construct()

__construct() : mixed

Returns

mixed —

substituteTextEntities()

substituteTextEntities(string  $string) : string

Substitute entities with the parsed equivalents. Use this on textual data in an HTML document (as opposed to attributes.)

Parameters

string $string

String to have entities parsed.

Returns

string —

Parsed string.

substituteAttrEntities()

substituteAttrEntities(string  $string) : string

Substitute entities with the parsed equivalents. Use this on attribute contents in documents.

Parameters

string $string

String to have entities parsed.

Returns

string —

Parsed string.

substituteNonSpecialEntities()

substituteNonSpecialEntities(string  $string) : string

Substitutes non-special entities with their parsed equivalents. Since running this whenever you have parsed character is t3h 5uck, we run it before everything else.

Parameters

string $string

String to have non-special entities parsed.

Returns

string —

Parsed string.

substituteSpecialEntities()

substituteSpecialEntities(string  $string) : string

Substitutes only special entities with their parsed equivalents.

Parameters

string $string

String to have non-special entities parsed.

Returns

string —

Parsed string.

entityCallback()

entityCallback(array  $matches) : string

Callback function for substituteNonSpecialEntities() that does the work.

Parameters

array $matches

PCRE matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).

Returns

string —

Replacement string.

nonSpecialEntityCallback()

nonSpecialEntityCallback(array  $matches) : string

Callback function for substituteNonSpecialEntities() that does the work.

Parameters

array $matches

PCRE matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).

Returns

string —

Replacement string.

specialEntityCallback()

specialEntityCallback(array  $matches) : string

Callback function for substituteSpecialEntities() that does the work.

This callback has same syntax as nonSpecialEntityCallback().

Parameters

array $matches

PCRE-style matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).

Returns

string —

Replacement string.