Jump to content

[solved] Combining Strings


damiancds

Recommended Posts

so, i've got a form, and they way i'd like it set up is to be able to combine a first last and surname together for sending through email, but i can't figure out how to. (like $name = $surname + $first + $last)I'd also like to know if it's possible and how to add strings and text together (like $message = $message + "something else")of course there'd likely be spaces between the additions (like $name = $surname + " " + $first + " " + $last), but that's all part of debuggingEDIT: Forgot to mention, but I did look into the php string reference page, and couldn't find anything close enough,thanks,got it. For those of you who need to know, you can add strings together with the dot operator, like so: $first = "bob";$last = "smith";$name = $first.$last; or if you want a space, $name = $first." ".$last;'course I wouldn't have had to post this if I had just taken the time in the first place to do the 2 minute google search. Still, maybe this should be added to the php string reference page.

Link to comment
Share on other sites

It's right there, under Concatenation Operator: http://www.w3schools.com/php/php_string.aspIt might be clarified on the Operators page, however. The only dot I see referenced is .= , which is a little odd. It makes sense if you follow the tutorial, but not as a reference.I don't know. No reference quite compares to php.net , so I don't worry too much.

Link to comment
Share on other sites

I honestly can't believed I missed that in the tutorials, but at least when i have another question like this, I'll actually know where to look.thanks,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...