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.

join("\r\n", $header);

join() is an alias for implode() but the former is easier to remember (and type):