How will you concatenate two strings in PHP?

28 Views

How will you concatenate two strings in PHP?

Concatenate two strings

For concatenate two strings together, we use dot (.) operator.

 
 <?php

$str1="Hello World! ";

$str2="Welcome to StudyZone4U.com";

echo $str1 . " " . $str2;

?>

// output
This will produce following result −

Hello World! Welcome to StudyZone4U.com

 

Tags:-
PHP