Remove entity encoded characters from a string.

Wrapper for PHP's html_entity_decode() function that contains typical ProcessWire usage defaults.

The arguments used here are identical to those for PHP's html_entity_decode function.

Usage

// basic usage
$string = $sanitizer->unentities(string $str);

// usage with all arguments
$string = $sanitizer->unentities(string $str, $flags = 3, string $encoding = 'UTF-8');

Arguments

NameType(s)Description
$strstring

String to remove entities from

$flags (optional)int or bool

See PHP html_entity_decode function for flags.

$encoding (optional)string

Encoding (default="UTF-8").

Return value

string

String with entities removed.

See Also


$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.97