Jump to content
Larry Ullman's Book Forums

ddefebbo

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by ddefebbo

  1. On page 23, there is a section in grey on using white space.  The example shown is this:

    print "Line 1\nLine2"; 

    I tested this and it returns simply

     

    Line 1 Line 2

     

    I looked in the PHP manual and found that I can use \n in the nl2br function. I tried it using this code:

    print nl2br("Line 1\nLine 2"); 

    And that worked, outputting this:

     

    Line 1

    Line 2

     

    Is this an error in the book, or am I missing something.  I checked the errata and found nothing.  

     

    Clearly I found one way (maybe the only way?), but I am wondering if I am missing something about how it is explained in chapter 1?

     
×
×
  • Create New...