Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- CR/LFs eaten by PHP !?
- Serge Wautier
October 18, 2005, 1:52 pm
rate this thread
I'm writing a PHP page which contains plain text.
Oddly enough, it there is a CRLF right after a php tag, this CRLF is eaten
and doesn't appear on the client side.
<?php header('Content-type: text/plain') ?>
a:<?php whatever(); ?>
This script appear at the client as:
instead of :
I noticed that adding a 2nd CRLF is a workaround since one CRLF then appears
at the client side. Adding any character (such as a space) between the php
tag and the crlf also preserves the CRLF.
However, I'd like to understand what happens. Is there a way to tell PHP to
preserve my CRLFs ?
serge at wautier dot net
- » fopen() taking ten seconds or more to come back...
- — Previous thread in » PHP Scripting Forum