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
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
No comments:
Post a Comment