check for a closing html tags in a string php code example
Example 1: php remove span tags from string
echo $new_string = preg_replace('/<span[^>]+\>/i', '', $content);
Example 2: remove html from string php
echo strip_tags("Hello <b>world!</b>");