NYCPHP Meetup

NYPHP.org

[nycphp-talk] heredoc help please?

Urb LeJeune urb at e-government.com
Wed Jan 30 18:08:03 EST 2008


At 04:41 PM 1/30/2008, you wrote:
>On 1/30/08 4:22 PM, "-- rada --" <radalapsker at yahoo.com> wrote:
>
>Hello all,
>
>Can anyone help me with heredoc?
>I have this code:
>
><?php
>
>echo <<<EOD
>
>This is a heredoc test.
>
>Test line 2.
>     Test line 3 with tab.
>
>EOD;
>?>
>
>(I am using PHP5 and zend for editor) and I am expecting to see 
>output with line breaks. Can't see them though, no matter what I do. 
>The heredoc just outputs everything on one line, like this:

         The individual lines, except of the last one, insert a \n 
not a <br /> if you want new
lines displayed you need <br /> or the <p></p> tags.




>This is a heredoc test. Test line 2. Test line 3 with tab.
>
>Any ideas? I do not have any extraneous characters around the 
>delimiters. I also thought the problem might be the line break style 
>of my editor (Zend) but I tried everything: "\n", "\r\n", and 
>"as-is" (whatever that is..) and still no go.
>
>If this is going to a browser, HTML browsers don't recognize line 
>breaks. Use a fn like nl2br.
>_______________________________________________
>New York PHP Community Talk Mailing List
>http://lists.nyphp.org/mailman/listinfo/talk
>
>NYPHPCon 2006 Presentations Online
>http://www.nyphpcon.com
>
>Show Your Participation in New York PHP
>http://www.nyphp.org/show_participation.php

Urb

Dr. Urban A. LeJeune, President
E-Government.com
609-294-0320  800-204-9545
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E-Government.com lowers you costs while increasing your expectations.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080130/f1948a27/attachment.html>


More information about the talk mailing list