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.

String Concatenation

Discussion in 'PHP' started by agentwazakashi, May 4, 2010.

  1. #1
    Hello, Suppose $subject and $message have already string values that came from input forms. And is stored on $body. How can I add a new line between them? So when it is displayed under the body section of mail () of php it will be display like this

    goat
    this is the message

    Codes:

    $subject ='goat';
    $message=' this is the message'
    $body= $subject.$message <------how can I add a new line or break line on this code? Thanks
     
    agentwazakashi, May 4, 2010 IP
  2. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Just add a new line character in between, like so;

    $body= $subject."\n".$message;
    PHP:
     
    lukeg32, May 5, 2010 IP
  3. agentwazakashi

    agentwazakashi Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thanks for the help, it works.
     
    agentwazakashi, May 5, 2010 IP