Given string return a new string containing only words
Available since version 3.0.195.
Usage
// basic usage
$string = $sanitizer->words($value);
// usage with all arguments
$string = $sanitizer->words($value, array $options = []);
Arguments
| Name | Type(s) | Description |
|---|
$value | | |
$options (optional) | array | separator (string): String to use to separate words Default:' 'ascii (string): Only allow ASCII characters in words? Default:falsekeepUnderscore (bool): Keep underscores as part of words? Default:falsekeepHyphen (bool): Keep hyphenated words? Default:falsekeepChars (array): Additional non word characters to keep Default:[]maxWordLength (int): Maximum word length Default:80minWordLength (int): Minimum word length Default:1maxLength (int): Maximum return value length Default:1024beautify (bool): Make ugly strings more pretty? This collapses and trims redundant separators Default:true
|
Return value
$sanitizer methods and properties
API reference based on ProcessWire core version 3.0.252