php remove span tags from string code example Example: php remove span tags from string echo $new_string = preg_replace('/<span[^>]+\>/i', '', $content);