Showing posts with label concatenation. Show all posts
Showing posts with label concatenation. Show all posts

Saturday, September 13, 2008

Concatenation

In PHP, strings could be easily concatenated using the dot (.) operator.

Example inputs

$name=”Rick”;
echo “My name is “.$name;
2.
echo “My name is “.”Rick”;
3.
$str1 = “My name is”;
$str2 = “Rick”;
$str3 = $str1.$str2;

Example outputs

1.
My name is Rick.
2.
My name is Rick
3.
My name is Rick