Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concat

Status
Not open for further replies.

riffy

Programmer
Mar 29, 2001
106
US
hi guys,

how do you concat strings in php?
i have two values, one for the first name and one for last name..
i want to join them but how?
i tried $fname + $lname
i also tried $fname & $lname

do i have to use the period?

thanks
arif
X-) s-)
 
This question has been answered many times in this forum, please use the search feature before you post.

Anyway, to concatenate string, you just say:

$string1.$string2;

or

$string1." ".$string2

or

$string1 .= " ".$string2;

See anything familiar? Yes, the dot (.) operator is what concatenates strings.

Hope this helps.

-Vic vic cherubini
krs-one@cnunited.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash
====
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top