I am removing several code lines from an xml file with preg_replace and str_replace
preg_replace('/(<!DOCTYPE(.*?)<fields )/s', '<fields ', $readSettings);
after the replace is done I am left with an empty spaces where the lines were. http://prntscr.com/3hegmb line 4 and 5 Is there any way to reformat the file once I am done or to remove the line and its space completely?