$sanitizer->purify() method

Purify HTML markup using HTML Purifier

See: htmlpurifier.org

Usage

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

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

Arguments

NameType(s)Description
strstring

String to purify

options (optional)array

See config options.

Return value

string

Purified markup string.


$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #538
    In the 538th issue of ProcessWire Weekly we’re going to share the latest news from the ProcessWire community; modules, sites, and more. Read on!
    Weekly.pw / 31 August 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer