RISOLTO:
non è problema di PHP ma dei browser e del document type, ho trovato questo thread:
http://www.webdeveloper.com/forum/sh...threadid=23947
e ad un certo punto dice:
XHTML has an embarrassing little problem. It's not compatible with HTML. Things like "<img />" or "<script />" are both perfectly good XHTML but will cause problems when treated as HTML or viewed on an HTML browser. If your goal is XHTML then go ahead and omit that space.
quindi basta togliere gli spazi bianchi oppure cambiare il document type in HTML 4.01 Strict