Echo is a print statement which is used for getting output. Both are more less same.
The code of Echo are –
<?php
echo " <h2> How to use Echo script </h2>"; echo " This is lutfar rahman learning echo programm<br>"; echo " This is lutfar's rahman learning echo programm <br>"; echo "This", "is lutfar's rahman", "learning echo", "programm";
Php language have some variables. which is used in scripting. The variable start wih "$" sign here. The variable is container. If you use text variables than double quotes the value. e.g. "Hello Rahman". Example of variables "$Mashiur" and "$mashiur" are two different variable. Now I am discussing different different types of variable here -
PHP Output Variables:
The echo statement is called output variables. Because it show output data on screen.
Example of PHP Output Variables: <html> <body> <?php $variables_faruk = "HI Faruk, How are you?"; echo "Hello Faruk. " .$variables_faruk. " Yes I am fine"; // Or another way we will get same output $variables_faruk = "Hi Faruk, How are you?"; echo " Hello FAruk $variables_faruk Yes I am fine";
?> </body> </html>
// Result is : Hello Faruk. HI Faruk, How are you? Yes I am fine