Advertisement

Google Ad Slot: content-top

PHP Concatenate Strings

~1 min read · PHP
On this page

String concatenation is used to join two or more strings together into a single string. PHP provides the dot operator (.) for this purpose.

Example
Try it yourself

An easier and better way is by using the power of double quotes.


By surrounding the two variables in double quotes with a white space between them, the white space will also be present in the result:

Example
Try it yourself