Thursday, May 9, 2013

PHP Concatenation Operator


The Concatenation Operator

There is only one string operator in PHP.
The concatenation operator (.)  is used to put two string values together.
To concatenate two variables together, use the dot (.) operator:

<?php
$txt1="Hello World";
$txt2="1234";
echo $txt1 . " " . $txt2;
?>

The output of the code above will be:
Hello World 1234

No comments:

Post a Comment