07 Sep 2005
Well, when you're generating PHP with no PHP-Book on the shelf nearby, you must find out all the oddities yourself, I guess...

For the echo-Function, there seem to be several differences depending on if you give it single quotation marks or double. So here is yet another of my new coding conventions:
To be able to debug the HTML output, new lines are needed to indent it. Interestingly, PHP will escape "\n" when single quotation marks ('\n') are used, so then "\n" will appear in your browser.
I use single quotation marks because they can wrap up the double quotation marks I need for the HTML output (mostly for attribute values). It won't work the other way round (echo with "", attribute values with '') because within the XSL transformation, single quotation marks become double quotation marks (sigh).
So I use echo('...'); as standard, and put an echo("\n"); after each line, when I want a newline in the output.
After a little while I got used to it, it's not that bad. And if it is explained in the comment, it's the best solution I can think of...
# lastedited 26 Sep 2005
You are seeing a selection of all entries on this page. See all there are.