Results 1 to 5 of 5

Thread: joining strings [resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Newcastle
    Posts
    260

    Unhappy joining strings [resolved]

    Right., how do i join a string and a variable togeather in php?

    im trying to join the following and I cant get iot to work
    [php]
    <? echo '<p><font face="Century Gothic">Thank you. Your reminder has been set for ' <what goes in here to join my variable to the rest?> '$temp1' ;

    ?>

    manythanks
    chrisio

    got it, its the full stop
    Last edited by Chrisio; Aug 14th, 2004 at 03:34 PM.

  2. #2
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667
    Or a Period for thoese in n.America the joys of the English language more complex and alot more fun than any computer language.

  3. #3
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    The correct way is to do this:
    PHP Code:
    echo "This is a " $string "; 
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by ober0330
    The correct way is to do this:
    PHP Code:
    echo "This is a " $string "; 
    Yes, that is the correct way to do it if you want a parse error.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    oops... forgot the end quote. I usually just don't add the dot and the quote at the end if the variable is at the end of the string, but I wanted the OP to see how to include a variable in a string. I was actually going to continue the string, but got lazy.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width