1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Quick php question

Discussion in 'PHP' started by Notting, Sep 24, 2007.

  1. #1
    Hi,

    When should you use:

    \n


    when programming PHP?


    Thanks
    notting
     
    Notting, Sep 24, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    This character stands for a new line. But remember that you need the <br /> tag to make a "visible" new line in the browser.
     
    nico_swd, Sep 24, 2007 IP
  3. fitforfreedom

    fitforfreedom Peon

    Messages:
    70
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    An example could be:

    <?php
    $text="This is a test mail.\nLook, if it worked.";
    mail("foo@bar.net","Test",$text);
    ?>

    The email should now look like this:

    This is a test mail.
    Look, if it worked.
     
    fitforfreedom, Sep 24, 2007 IP