In PHP how can I combine two strings like
The above doesn't seem to work.Code:$myString = "Hey";
$myString += " you";
I dont know but perhaps this will do:-
Code:$first = 'Hey'; $last = ' you'; $full = $first . ' ' . $last;
Yes, use a dot instead of the +
Not sure if this works, never tried:Code:$myString = "Hey";
$myString = $myString . " you";
but I doubt it.Code:$myString = "Hey";
$myString .= " you";
what about array_push()
edit: i wasnt fully coherant when i posted this...but the above is if you want to combined two arrays, not strings
Last edited by John; 09-24-2006 at 11:50 PM.
I believe you can do that with the echo command
EDIT: Oops, I completely misread that question. Ignore this post.Code:echo $myString + "another string";
![]()
Last edited by CheeseBurgerMan; 09-24-2006 at 07:08 AM. Reason: Misread question
The . works - I figured it out after I posted this. Sorry for not updating and thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks