[php] Strings

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by taekwondokid42, Apr 20, 2008.

  1. taekwondokid42

    taekwondokid42 New Member

    Messages:
    268
    Likes Received:
    0
    Trophy Points:
    0
    How can I add text to a string of text?

    Example:

    $asdf = 'asdf';

    if($x == $y){
    $asdf = $asdf + 'arg!';
    }

    The result I want is for $asdf to = 'asdfarg!', however, when I use the '+' operator, it just seems to reset the variable. Is there a way I can append a variable?
     
  2. konekt

    konekt New Member

    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    0
    $asdf = $asdf.'arg!';

    The dot...
     
  3. taekwondokid42

    taekwondokid42 New Member

    Messages:
    268
    Likes Received:
    0
    Trophy Points:
    0
    lol how could I forget?

    thank you.
     
  4. cowctcat

    cowctcat New Member

    Messages:
    401
    Likes Received:
    0
    Trophy Points:
    0
    or you could make it simpler and say $asdf .= 'arg!'
     

Share This Page