Hello Friends, how are you?
I am showing now, how to print variable and string at a time in php? So, consider the below code-
<?php
//this is variable
$name=”Thouhedul Islam Suchi”;
echo “Hello, “. $name.”. Thank you for visiting my site.”;
?>
Explain:
First I take a variable $name where I put my name. I just want to print this name with other text. Then I make echo statement. After finishing “Hello, ”, I didn’t close my statement by using ;. After that, I use a . which call concatenation sign for adding with variable and string. Then I put my variable. After putting variable, I put concatenation sign again to add string with variable. Finally I close my echo statement by using ; sign.
Output:
Hello, Thouhedul Islam Suchi. Thank you for visiting my site.