PHP echo and print have been learning php for more than two months. Learn how to do something, use basic functions, and use help to open and search. No problem
However, the descriptions on the php homepage are very vague. after many parameters are completed, they still cannot be understood, and the truth can be found only in practice. There is nothing wrong with this.
The difference between echo and print was first met. I have summarized the following:
Differences between echo () and print ()
What is the difference between string output echo and echo ?!!
PHP? Actually, none of them are strict. They can all work normally without arc.
At present, we only find the big difference between three points.
1. can echo () be separated by commas? Number of strings, print () is not allowed
Print "Hello", "World"; // syntax error.
Echo "Hello", "World"; // syntax OK !!
※After the Arc "()" is used for echo (), add a comma "," to distinguish? No number of strings! Note.
2. print () returns? If yes, echo () is not returned.
1 $ output1 = print "Hello World"; // This output has
2 $ output2 = echo "Hello World"; // This does not exist.
3. if you do not need to return results, echo () is faster.
Echo () vs print ()
Echoing 100000 of nothing
Exe Time is 0.034925937652588 secs.
Printing 100000 of nothing
Exe Time I s 0.037981986999512 secs.
Do you need to determine this gap?