Breaking News

PHP-MySQLi Series 5.6 || String Operators




String operators:

String operators are used to merge two or more strings and variables.
There are two string operators. They are;
1) Concatenation operator (.)
2) Concatenation assignment operator (.=)

Concatenation operator:
It helps to join two character strings/variable together. We use (. dot) symbol.

Example:
<?php
$a = "Hello";
$b = "World";
echo $a . $b;
?>

Output:
Hello World.

Concatenation assignment operator:
It helps appends the argument on the right side to the argument on the left side. We use (.=) symbol.

Example:
<?php
$string1="Hello";
$srting2="World";
echo $string1 .=$string2;
?>

Output:
Hello World

No comments