How append a string in PHP
Answer: Use the PHP String Operators
There is no specific function to append a string in PHP. But you can use the PHP concatenation assignment operator (
.=) to append a string with another string.
Let's check out the following example to understand how it basically works:
ExampleRun this code »
<?php $a = "Hello"; $a .= " World!"; echo $a; // Outputs: Hello World! ?>
See the tutorial on PHP operators to learn about the operators in detail.
Here are some more FAQ related to this topic: