1. Echo Statement
2. Print Statements
The difference between the two
echo-capable of outputting more than one string, no return value
Print-can only output one string and return a value of 1
echo is faster than print at run time because it has no return value.
Echo statement
Echo is a language structure that can be used without parentheses. Echo and Echo ().
<?php echo "Hello world!<br>"; Echo ("Hello world!<br>"); echo "Hello", "world!";? >
The string can contain HTML code that can be parsed normally.
Print statement
Print is also a language structure that can be used without parentheses: print or print () with a return value of 1
<?php print "Hello world!<br>"; Print ("Hello world!<br>"); Print "Hello", "world!";? >
Think: How do I see the print return value?
<?php Echo (print "Hello world!");? >
The return value is 1.
This article is from the "Thales" blog, make sure to keep this source http://thales.blog.51cto.com/7311175/1631754
(ii) BASIC syntax---Output statements echo and print