Convert a string containing markup or entities to be plain text

Usage

// basic usage
$string = $sanitizer->markupToText(string $value);

// usage with all arguments
$string = $sanitizer->markupToText(string $value, array $options = []);

Arguments

NameType(s)Description
$valuestring

String you want to convert

$options (optional)array

Options to modify default behavior:

  • newline (string): Character(s) to replace newlines with (default="\n").
  • separator (string): Character(s) to separate HTML
  • items with (default="\n").
  • entities (bool): Entity encode returned value? (default=false).
  • trim (string): Character(s) to trim from beginning and end of value (default=" -,:;|\n\t").

Return value

string

Converted string of text


$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.109