<?php
$msg = '<b onmouseover="alert(1)"';
$s1 = strip_tags($msg, '<b>');
echo "After strip_tags: " . $s1 . PHP_EOL;
$s2 = preg_replace('/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i', '<$1$2>', $s1);
echo "After regex: " . $s2 . PHP_EOL;
