what is echo in php?

echo is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo (unlike some other language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.
 
In the PHP we use echo function for display any information.for example:-
<?PHP
echo"hello";
?>
 
Same thing goes with function print, but echo dispays content faster, so that's why it's more comonnly used than print.
 
PHP echo and print Statements. echo and print are more or less the same. They are both used to output data to the screen. The differences are small: echo has no return value while print has a return value of 1 so it can be used in expressions.
 
Back
Top