How to Combine/Append two different strings in PHP

How to concatenate multiple string variables using dot(.) operator and show on screen using echo.

Dot operator is used to combine two or multiple strings at a time. With the use of dot operator you can easily merge $string value variables and display them on screen. So here is the complete step by step tutorial for How to Combine/Append two different strings in PHP.

android-project-download-code-button

How to Combine/Append two different strings in PHP.

Code for append-two-strings file.

 <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Append two String in PHP</title>
</head>

<body>

<?php

$one = " String - 1 ";
$two = " String - 2 ";


echo $one . $two ;


//Another way :

$one .= $two;

echo '</br>' . $one;

?>

</body>
</html>

Screenshot:

How to Combine/Append two different strings in PHP

Click here to download How to Combine/Append two different strings in PHP project source code file.