How to sanitize a string in PHP

1 Answer

0 votes
$s = "<h1>PHP</h1>";
$s = filter_var($s, FILTER_SANITIZE_STRING);
echo $s;

/*
run:

PHP

*/

 



answered Aug 3, 2018 by avibootz

Related questions

2 answers 342 views
2 answers 290 views
...