php

Join or concatenate two or multiple strings in PHP

You can use the dot(.) operator of PHP to join or concatenate multiple strings into one.

<?php
  $str1 = "We are ";
  $str2 = "Devsheet ";
  $str3 = "Programmers";
  
  $result1 = $str1 . $str2;
  //-> We are Devsheet 
  
  $result2 = $str1 . $str2 . $str3;
  //-> We are Devsheet Programmers
?>
Was this helpful?