<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <title>Comments for PHP and newline characters</title>
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters" />
    <link rel="self" type="application/atom+xml" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters" />
    <id>tag:bradchoate.com,2007://4-</id>
    <updated>2007-05-11T06:02:08Z</updated>
    <subtitle>The man, the legend.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type -en-trunk--20070910</generator>
 

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22262</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22262" />
    <title>Comment from waffle.wootest.net on 2007-05-11</title>
    <author>
        <name>waffle.wootest.net</name>
        <uri>http://waffle.wootest.net/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://waffle.wootest.net/">
        This might be because some UNIX tools add a newline to files, and some PHP includes handling header-level output are written like that. If their inclusion would print the newline, the output would be started and headers prevented from being sent.]]>
    </content>
    <published>2007-05-11T16:15:57Z</published>
</entry>

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22264</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22264" />
    <title>Comment from Brad Choate on 2007-05-11</title>
    <author>
        <name>Brad Choate</name>
        <uri>http://bradchoate.com/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://bradchoate.com/">
        @waffle.wootest.net: An interesting edge-case, but one that could be handled by only applying this rule to end-of-file situations. And even then, an ini setting to preserve whitespace should still trump that. For some, every byte is precious. Even the invisible ones.]]>
    </content>
    <published>2007-05-11T22:08:45Z</published>
</entry>

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22265</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22265" />
    <title>Comment from waffle.wootest.net on 2007-05-11</title>
    <author>
        <name>waffle.wootest.net</name>
        <uri>http://waffle.wootest.net/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://waffle.wootest.net/">
        Sure - although that would take the consistency out of it. It was only a theory, if one I deemed plausible.

<p>An ini setting would be disastrous. Apply that to the file I described with trailing newline and headers being set, and consider some poor chap trying it on his home server (untweaked ini) and his host (diddled-with ini). Even if it didn't have those effects, I think it'd be a picky thing to have a setting for. PHP doesn't need more settings at this stage. ;)</p>]]>
    </content>
    <published>2007-05-11T22:22:24Z</published>
</entry>

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22266</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22266" />
    <title>Comment from Don on 2007-05-12</title>
    <author>
        <name>Don</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        "...so this may be well accepted in the PHP community."

<p>I assume you mean "may not be well accepted."</p>]]>
    </content>
    <published>2007-05-12T19:03:57Z</published>
</entry>

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22267</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22267" />
    <title>Comment from Brad Choate on 2007-05-12</title>
    <author>
        <name>Brad Choate</name>
        <uri>http://bradchoate.com/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://bradchoate.com/">
        @Don: No, I meant may be well accepted. I wasn't referring to my post, but to the behavior I am describing. I figure those that are more familiar with this peculiarity have come to terms with it, but I haven't.]]>
    </content>
    <published>2007-05-12T19:08:13Z</published>
</entry>

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22269</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22269" />
    <title>Comment from JazzMan on 2007-05-18</title>
    <author>
        <name>JazzMan</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        I don't think this is a PHP problem. The behaviour you describe is happening outside the PHP block. As such, it is outside the control of PHP. It seems to be a symptom of how HTML is interpreted and thus is server and/or browser dependent.]]>
    </content>
    <published>2007-05-18T12:46:28Z</published>
</entry>

<entry>
    <id>tag:bradchoate.com,2007://4.2638-comment:22270</id>
    <thr:in-reply-to ref="tag:bradchoate.com,2007://4.2638" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters"/>
 
    <link rel="alternate" type="text/html" href="http://bradchoate.com/weblog/2007/05/10/php-and-newline-characters#c22270" />
    <title>Comment from Brad Choate on 2007-05-18</title>
    <author>
        <name>Brad Choate</name>
        <uri>http://bradchoate.com/</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://bradchoate.com/">
        @JazzMan: Nope, this is definitely a PHP issue. It's even documented in their <a href="http://us.php.net/manual/en/faq.using.php#faq.using.newlines">FAQ</a>. You can observe this happening using the PHP command-line tool as well, so it's not something the browser is doing either.]]>
    </content>
    <published>2007-05-18T13:38:50Z</published>
</entry>


</feed>