- htmlentities: documentation ( source)
- strip_tags: documentation ( source)
- htmlspecialchars: documentation ( source)
<?php
function makeItSafe($value) {
htmlspecialchars($value);
strip_tags($value);
htmlentities($value, ENT_QUOTES);
return $value;
}
echo makeItSafe('te~!#<p>$%^&*()st@test.com');