PHP: String operator
String Operators
There are two string operators : concatenation operator ('.') and concatenating assignment operator ('.=').
Example : PHP string concatenation operator
<?php
$x = "Good";
$y = $x ." Morning";
// now $y contains "Good Morning "
echo $y;
?>
Output:
Good Morning
View the example in the browser
Example: PHP string concatenating assignment operator
<?php
$x = "Good";
$x.= " Morning";
echo $x;
?>
Output
Good Morning
View the example of in the browser
Previous: Bitwise Operators
Next: Array Operators
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/php/operators/string-operators.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics