PHP echo Function
The PHP echo Function is used to print a text output to the screen.You can use it in an html tag inside the echo command.
You can combine more than one variable and print it on the screen with the echo command.
// Example use of an echo command
echo "Hello friends";
//Using html tag inside the echo command
$string = "Hello friends";
echo "<br>I am learning php";
//echo by combining multiple variables
$string2="How are you";
echo $string1 . " " . $string2;
// It is the point joining operator. It allowed us to make value1 + html tag + value2.
//Using variables in text in php
echo "My car " . $araba['mercedes'] . " model.";
//In php echo, passing the bottom line in the code block does not affect the result, so you can use the <br> tag.
echo "Inside the label
get to the bottom line
Doesn't mean anything";
// echo single quote double quote difference
$blue = "blue";
echo "this car $blue";
echo 'this car $blue';
// echo short use
$color = "blue";
<p>This Car <?=$color;?> color.</p>
Php echo is not actually a function, so you can use () without parentheses. It differs from the echo print_r function. When you use print_r it shows all values in the array.When you want to reach an article, using echo allows you to process faster.