Sanitize filters
suggest changeUse an operation that matches the kind of data you are sanitizing. For example, strip_tags() removes HTML and PHP tags from a string. The old FILTER_SANITIZE_STRING filter is deprecated in PHP 8.1 and later.
Example
$string = "<p>Example</p>";
$newstring = strip_tags($string);
var_dump($newstring); // string(7) "Example"
The example removes the HTML tags from the $string variable.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents