Sanitize filters

suggest change

Use 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents