Page 1 of 1

Disappearing EOL...can you solve the mystery?

Posted: Fri Sep 08, 2006 3:54 pm
by SorryDev
I have this PHP code:

Code: Select all

<p>
            Your request was invalid.<br />
            The following error was reported: "<?php echo $errorMessage; ?>"<br /><br />
            <?php echo $GLOBALS['baseName']; ?> @ <?php echo $GLOBALS['baseUri']; ?>
        </p>
When interpreted by the Web server, I get the following output:

Code: Select all

<p>
            Your request was invalid.<br />
            The following error was reported: "Invalid request. (missing or empty uuid)"<br /><br />
            Blah blah @ Blah blah        </p>
Question:

Why did the EOL/LF after

Code: Select all

<?php echo $GLOBALS['baseUri']; ?>
get zapped?

Posted: Fri Sep 08, 2006 4:03 pm
by feyd
PHP automatically removes a trailing carriage return.

Posted: Fri Sep 08, 2006 4:38 pm
by SorryDev
feyd wrote:PHP automatically removes a trailing carriage return.
Really?

Is that new in PHP 5 or was it always there?

Posted: Fri Sep 08, 2006 4:46 pm
by feyd
Always been there as far as I can remember.

Posted: Fri Sep 08, 2006 4:49 pm
by SorryDev
feyd wrote:Always been there as far as I can remember.
Thanks for the tip!

Are you really Harkonnen? :D

Posted: Fri Sep 08, 2006 4:50 pm
by feyd
SorryDev wrote:Are you really Harkonnen? :D
I've got the slaves to prove it. :)

Posted: Fri Sep 08, 2006 4:59 pm
by SorryDev
feyd wrote:
SorryDev wrote:Are you really Harkonnen? :D
I've got the slaves to prove it. :)
I ask because my usual forum name is DuneMessiah...
It would be the first time I get help from your kind. :D

Just kidding...thanks for the tip.