We have given two strings and the task is to append a string str1 with another string str2 in PHP. There is no specific function to append a string in PHP. In order to do this task, we have the this operator in PHP:
Using Concatenation assignment operator (“.=”): The Concatenation assignment operator is used to append a string str1 with another string str2.
$x .= $y
Using Concatenation Operator(“.”): The Concatenation operator is used to append a string str1 with another string str2 by concatenation of str1 and str2.
$x . $y
- PHP append one array to another
- ArrayObject append() function in PHP
- PHP | ArrayIterator append() Function
- PHP | AppendIterator append() Function
- How to append data in JSON file through HTML form using PHP ?
- jQuery | append() Method
- p5.js | append() function
- How to append an element in two seconds using jQuery ?
- How to append Angular styles in footer ?
- How to Convert Data URI to File then append to FormData?
- How to append class if condition is true in Haml?
- Express.js res.append() Function
- HTML DOM ParentNode.append() Method
- D3.js selection.append() Function
- PHP | Program to check a string is a rotation of another string
- PHP 5 vs PHP 7
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.