PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hmm, looks ok (presuming the w was a typo and is actually 'w').
The extra newline must be coming from 'somewhere else' .. what OS is this on, windows, *nix, mac etc.. ? And when you say "it doesn't always happen" can you pin down exactly under what circumstances it does and does not happen?