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
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    An easy question - new lines in code

    Hi Guys,

    I'm sure this is very easy, but it's been driving me mental for ages! In php how do you return a new line in your code. I know it's /n but I can't seem to get it working at all!!

    PHP Code:
    echo '<div class="one"></div>/n'
    Thanks

  • #2
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts
    lol if memory serves me correct its \n not /n
    Last edited by Rappa; 10-31-2007 at 03:48 PM.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts
    Yep, that's what I meant to write (lol) but that's not working (which is what I meant!! ;-)

    Any further ideas?

  • #4
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    It has to be in double quotes:

    PHP Code:
    echo "<div class=\"one\"></div>\n";
    // or
    echo '<div class="one"></div>' "\n"

  • Users who have thanked Mwnciau for this post:

    stfc_boy (10-31-2007)


  •  

    Posting Permissions

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