- strip_tags: documentation ( source)
- htmlspecialchars: documentation ( source)
<?php
$input = "I <3 your website, it's awesome! Great job, fast, safe and secure! :D";
$output = strip_tags($input);
$output = htmlspecialchars($output, ENT_QUOTES | ENT_HTML5 | ENT_DISALLOWED | ENT_SUBSTITUTE, 'UTF-8');
echo $output;