PHP string concatenation
In this small article I will show you how to use PHP string concatenation possibilities.
Tutorial info:
| Name: | PHP string concatenation |
| Total steps: | 1 |
| Category: | Basics |
| Level: | Beginner |
Bookmark PHP string concatenation
Step 1 - PHP string concatenation
PHP string concatenation
String concatenation is the string manipulation method when you join 2 or more strings together. In PHP it is a quite easy task. You can use the concatenation operator which is the '.' (dot). You can join 2 or more strings into one as follows:
Code:
<?php $str1 = 'This '; $str2 = 'is a '; $str3 = 'test string'; $full = $str1.$str2.$str3; echo $full; ?>
Besides this you can use the operator to append a string to an existing one like this:
If you concatenate a number with a string then the number will be converted into a string value so the output will be a string as follows:
Tags: php string concatenation, php string concat, string concatenation
| PHP string concatenation - Table of contents |
|---|
| Step 1 - PHP string concatenation |
