What Is The Difference Between Echo And Print Commands?


1 Answers

Ellie Hoe Profile
Ellie Hoe answered
print and echo are commands used to show the message on the computer screen. These both commands perform same function i.e. Display the output. E.g


<. ?. Php
print "Hi how are you!";
echo " Hi how are you!";

Output :
Hi how are you!
Hi how are you!

The above example displays the same result on the screen. But there is small difference between these two commands and it all depends upon their and outcome usage. The print command can return a true/false value while echo command can not. Print command can be helpful in some type of script execution. Echo command is considered much faster executed command than the print command.

Answer Question