Question : PHP Concatenate String
Answered by : joyous-jaguar-ctnnk5onv031
$var1 = "hello";
$var2 = "world";
$concat = $var1.' '.$var2; // $concat ='hello world' (with single quote)
$concat = "$var1 $var2"; // $concat ='hello world' ( with double quote)
Source : | Last Update : Sat, 13 Aug 22
Question : String Concatenation in PHP
Answered by : pawan-mall
phpCopy<?php
$mystring1 = "This is the first string. ";
$mystring2 = "This is the second string";
$finalString = sprintf("%s %s", $mystring1, $mystring2);
echo($finalString);
?>
Source : https://www.delftstack.com/howto/php/php-string-concatenation/ | Last Update : Fri, 30 Apr 21
Question : php concat variable and string
Answered by : christian-icwbcen3kvoo
<?php $name = "Paul"; $age = 26; echo "My name is {$name}, I'm {$age} years old ";
Source : | Last Update : Wed, 31 Mar 21
Question : merge strings in php
Answered by : relieved-raccoon-bd790mszy0t1
$merge = "Hello" . " World!";
Source : | Last Update : Mon, 24 Jan 22
Question : php how to concatenate strings
Answered by : expensive-echidna-0pcavw1f95je
$data1="The colour is ";
$data2="red";
$result=$data1.$data2; // The colour is red
Source : https://stackoverflow.com/questions/8336858/how-can-i-combine-two-strings-together-in-php | Last Update : Fri, 24 Jun 22
Question : php string concatenation
Answered by : nimorum
<?php
// First String
$a = 'Hello';
// Second String
$b = 'World!';
// Concatenation Of String
$c = $a.$b;
// print Concatenate String
echo " $c \n";
?>
Source : https://www.geeksforgeeks.org/concatenation-two-string-php/ | Last Update : Thu, 25 Aug 22