PHP Echo, PHP Print – PHP Tutorial – 7

What is echo and print ?
In PHP echo and print are outpur statements. Which is used for output data to the screen.

What is php echo ?
echo has no any return value. we cannot use expressions in echo statement. We can use echo statement with or without parentheses i.e. echo or echo(). In echo statement when we use single inverted comma around the value then echo statement print value as a string, means it is not print a variable value, it print only text which you write around in single quotes.

What is PHP Print ?
Print statement have a return value so we can return a value. We can use expressions in print statement, In this statement we can use with or withour parentheses i.e. print or print(). In this statement when we use single inverted comma around the value then print statement print value as a string, means it is not print a variable value, it print only text which we write around in single quotes.

Thank You

source