Sanitize short string of text to single line without HTML
This sanitizer is useful for short strings of input text like like first and last names, street names, search queries, etc.
Please note the default 255 character max length setting.
- If using returned value for front-end output, be sure to run it through
$str = " <strong>Hello World</strong> How are you doing today? "; echo $sanitizer->text($str); // outputs: Hello World How are you doing today?
// basic usage $string = $sanitizer->text(string $value); // usage with all arguments $string = $sanitizer->text(string $value, array $options = );
String value to sanitize
Options to modify default behavior:
API reference based on ProcessWire core version 3.0.84