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