Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: PHp noob (ASK)

  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Posts
    141
    Thanks
    3
    Thanked 1 Time in 1 Post

    PHp noob (ASK)

    I wonder why my code's output is like this
    output:
    line one line two ( in one line)

    while the coding is
    print "line one\n";
    print "line two\n";

    this should look like
    output:
    line one
    line two ( in separate line)

    is it because the book I am reading has older version .
    and my xampp is newer version or what?
    tHHHAAANKKK YOUUUUU

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    Are printing to a web page? Or are you printing to a file?

    If you're printing to a web page, you'll want to replace the newline chars with <br> so your output will look like this:

    line one
    line two
    etc.
    etc.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #3
    Regular Coder
    Join Date
    Apr 2007
    Posts
    141
    Thanks
    3
    Thanked 1 Time in 1 Post
    oohh got it .
    I print it to website
    not really a website though
    I typed it like <?php ?> and save as .php file.

    so it came up not exactly like the book says,
    thats why i was wondering .thank you...

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Using \n and such is used a lot for email forms, it will format emails sent to you. Thats just something more practical :P


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •