php

How to Concatenate Two Strings in PHP

In this tutorial, we are going to see how to concatenate two Strings in PHP. There is no specific function to concatenate two strings in PHP. But you can use the concatenation operator (.=) To concatenate one string with another string.
 

How to Concatenate Two Strings in PHP
<?php
	$str = "Hello";
	$str .= " World!";
	echo $str;
?>

Output:

Hello World!
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *