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