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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -