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.

simplifying and spacing

Discussion in 'PHP' started by rojojat, Nov 28, 2008.

  1. #1
    Hi

    I have a small pice of code I am trying to make simpler.
    echo"welcome";echo$_SESSION['user'];

    The browser result is:

    welcomegeorge

    I am looking to put a space in between welcome and george
    SEMrush
     
    rojojat, Nov 28, 2008 IP
    SEMrush
  2. joebert

    joebert Well-Known Member

    Messages:
    2,152
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    echo "welcome {$_SESSION['user']}";
    Code (markup):
    echo 'welcome ' . $_SESSION['user'];
    Code (markup):
     
    joebert, Nov 28, 2008 IP
  3. rojojat

    rojojat Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank You For your help.
     
    rojojat, Nov 28, 2008 IP
  4. mrmaf

    mrmaf Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    There are lot of ways to solve ur issue

    1) echo "welcome"." ".$_SESSION['user'];

    2) echo "welcome $_SESSION['user'];";

    3) echo "welcome"." ".$_SESSION['user'];

    Happy Coding :)
     
    mrmaf, Nov 29, 2008 IP