forgot how to insert a space in a variable

Discussion in 'PHP' started by Mike, Sep 4, 2005.

  1. Mike

    Mike New Member

    Joined:
    Oct 19, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.go4expert.com/
    I forgot how to insert a space in a variable. The code below displays two database variables side by side, like "FirstNameLastName" How can I insert a space so it displays "FirstName LastName"?

    $Name = $FirstName.$LastName;
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    $Name = $FirstName.' '.$LastName;
     
  3. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    736
    Likes Received:
    39
    Trophy Points:
    28
    $Name = "$FirstName $LastName";

    The above option is also there but the better one is already told by Shabbir.
     
  4. Mike

    Mike New Member

    Joined:
    Oct 19, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    http://www.go4expert.com/
    simple, simple haha
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice