xml - PHP Increase Indentation of DOMDocument->saveXML? -


i need increase indentation of formatted xml file 4 spaces 2 tried using regex powered xml formatter forgot indent closing tags on new line.

what options have, using preg_replace seems best option, search regex /( {2}^anything_except_space)/ that's far can seem get.

thanks, xeross

preg_replace('/^[ ]+(?=<)/m','$0$0',$string); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -