Re: "\n" in PHP

From: Lc (hoho_at_not.me)
Date: 07/12/04


Date: Mon, 12 Jul 2004 06:39:25 +0200

Michael, could you give us an example of "pre pre tag"? tx,

"Michael Austin" <maustin@firstdbasource.com> a écrit dans le message de
news:6djIc.14616$v73.1473@newssvr24.news.prodigy.com...
> Andy Hassall wrote:
>
> > On Sun, 11 Jul 2004 17:48:44 GMT, Mudge <mark1822@hotmail.com> wrote:
> >
> >
> >>I am reading a book called "PHP, Apache, MySQL Web Development"
> >>http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764557440.html
> >>
> >>and in its example code it sometimes will have a "\n" in it. It is
driving
> >>me crazy because php will ignore the "\n"s so i have no idea why this
book
> >>has them in there. Does anybody know?
> >
> >
> > What makes you think PHP will ignore the "\n"s? It does not.
> >
> >
> >>For example:
> >>
> >>if (mysql_num_rows($result))
> >>{
> >> echo "<div class=\"scroller\">\n";
> >>
> >>Why does the book put the "\n"s in there?
> >
> >
> > To make the produced HTML source easier to read, most likely.
> >
> > Although if they were concerned about readability they'd consider using
single
> > quotes instead of doubles, and avoiding all those backslashes.
> >
> > Maybe you're thinking of the fact that newlines aren't significant in
HTML,
> > i.e. it won't force a new line in the rendered output.
>
> unless of course you are using pre /pre tags then it will render the
> data on the next line...
>
> >
> > --
> > Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
> > http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
>
> Michael Austin.



Relevant Pages

  • Re: Struts in a WebSphere Cluster
    ... Michael wrote: ... > tag. ... It's when we go to multiple ... Are you using NFS mounts? ...
    (comp.lang.java.programmer)
  • Re: How do draw new window immideately?
    ... complete write out some javascript that will hide that <DIV> tag ... Michael ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: "The Office" Has Just Jumped The Shark
    ... I thought it was brilliant. ... Pam's expression when Michael was trying ... to kiss Oscar was hilarious, Jim's experience at the other branch was ... and the tag at the end with the gaydar was hilarious. ...
    (rec.arts.tv)
  • Re: Regex help
    ... Michael ... > I have a file with following htmlt tags: ... > some text, can be anything here, also any tag ... > Dim m As Match = re.Match ...
    (microsoft.public.dotnet.languages.vb)