- preg_replace: documentation ( source)
<?php
$string = '<p>I am <30 years old and weight <12st</p>';
$html = preg_replace('/^\s*<[^>]+>\s*|\s*<\/[^>]+>\s*\z/', '', $string);
$final = preg_replace('/[^A-Za-z0-9 !@#$%^&*().]/u', '', $html);
echo $final;