<?php
$number = 8;
$txt = "the number is".$number.", ok?"; //Use a dot to combine
echo $txt;
?>
$var1 = "hello";
$var2 = "world";
$concat = $var1.' '.$var2; // $concat ='hello world' (with single quote)
$concat = "$var1 $var2"; // $concat ='hello world' ( with double quote)
<?php
$name = "Paul";
$age = 26;
echo "My name is {$name}, I'm {$age} years old ";
<?php
// First String
$a = 'Hello';
// Second String
$b = 'World!';
// Concatenation Of String
$c = $a.$b;
// print Concatenate String
echo " $c
";
?>
<?php
// First String
$a = 'Hello';
// Second String
$b = 'World!';
// Concatenation Of String
$c = $a.$b;
// print Concatenate String
echo " $c
";
?>
$data1="The colour is ";
$data2="red";
$result=$data1.$data2; // The colour is red
$merge = "Hello" . " World!";
$name [] = ['abhi']