This is nice to know, thanks for sharing. Also remember that join() is great for tasks like this and is supported back to PHP 4. I use it frequently when needing to construct complex strings. Just set them up as arrays first then join them.

[code]
join("\r\n", $header);
[/code]

join() is an alias for implode() but the former is easier to remember (and type):
http://php.net/manual/en/function.implode.php