$sanitizer->htmlClasses() method

Sanitize string to ASCII-only space-separated HTML class attribute values with no duplicates

See additional notes in Sanitizer::htmlClass() method.

Available since version 3.0.212.


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

// usage with all arguments
$string = $sanitizer->htmlClasses($value, bool $getArray = false);


valuestring, array
getArray (optional)bool

Get array rather than string? (default=false)

Return value

string array

$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.214

Twitter updates

    Error retrieving Twitter status

Latest news

  • ProcessWire Weekly #472
    In the 472nd issue of ProcessWire Weekly we'll check out ProcessWire 3.0.218, the very first add-on WireCache module, a new third party FormBuilder add-on module, and more. Read on!
    Weekly.pw / 28 May 2023
  • A look at the new Page Edit Restore module
    The new Page Edit Restore module helps to prevent page edits in the admin from getting lost when the user’s session is lost. This post covers it in detail.
    Blog / 12 May 2023
  • Subscribe to weekly ProcessWire news

I just love the easy and intuitive ProcessWire API. ProcessWire rocks!” —Jens Martsch, Web developer