Re: CR/LFs eaten by PHP !?



Serge Wautier wrote:
> Env.: PHP 4.4.0 / IIS 5.1 / XP Pro
>
> Hi All,
>
> 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.
>
> e.g.:
> <?php header('Content-type: text/plain') ?>
> a:<?php whatever(); ?>
> b:123
> c:456
>
> This script appear at the client as:
> a:whateverb:123
> c:456
>
> instead of :
>
> a:whatever
> b:123
> c:456
>
> 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 ?
>

http://www.php.net/manual/en/faq.using.php#faq.using.newlines

--
Oli

.



Relevant Pages

  • Re: XML encoding
    ... Thanks for the info and hints. ... I'm new to PHP so your comments are helpful. ... Is there any specific need for a CRLF line break? ... SGML/XML also allow single quotes around attribute ...
    (comp.lang.php)
  • PHP fopen() CRLF Injection
    ... PHP fopen() CRLF Injection ... vulnerability even opens up for arbitrary net connections, ... some PHP scripts into proxies and open mail relays. ... This functionality is vulnerable to some CRLF ...
    (Bugtraq)
  • [VulnWatch] PHP fopen() CRLF Injection
    ... PHP fopen() CRLF Injection ... vulnerability even opens up for arbitrary net connections, ... some PHP scripts into proxies and open mail relays. ... This functionality is vulnerable to some CRLF ...
    (VulnWatch)
  • CR/LFs eaten by PHP !?
    ... 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. ...
    (comp.lang.php)
  • PHP, Java, & a strange number...
    ... I am having problems trying to get PHP to return a Java .jar file. ... CRLF CRLF 190 CRLF ...
    (php.general)