HallMarc Websites wrote:



problem was solved, it was just a simple typo and sometimes all it takes is
a fresh pair of eyes. The confusing part comes in when it prints to the
screen and your mind looks in that area of the code and finds nothing

LOL - I wanted to display generated XML on screen.
Displaying it as a big long string doesn't work so well, so I passed it through tidy just to get pretty indentation.

Tidy did a pretty could job, but for the life of me I couldn't figure out how to do an xml fragment with tidy - it always headed head and body tags (the config option for html in tidy is automatically disabled in xml output mode)

Anyway - so after using a regex to get rid of the head and body tags, there was excess indention - and I spent almost 20 minutes trying to figure out why '/^\s{4}/','' was only working on the first line.

What I was seeing on screen in browser was multiline, but to php (and thus preg_replace) it was still all one string, so ^ would only match once.

Sometimes it helps to take a break, watch a Stargate episode, and clear your mind.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to