Document directory
- Differences between echo () and print ()
Php has been self-taught 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 ()
Same as string outputEcho and echo
What is the difference ?!!
In the PHP statement, none of them are very strict.
They do not need arc.() And work normally
.
At present, we only find the big difference between three points.
1.echo()
You can use commas (,) to separate the number of shards,Print () is not allowed
Print "Hello", "World"; // syntax error.
Echo "Hello", "World"; // syntax OK !!
※echo()
After using the arc "()", add the comma "," to distinguish between the string numbers! Note.
2.print()
Return result,echo()
But does not return. 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 a little faster
.
Echo () vs print ()
Echoing 100000 of nothing
Exe Time is 0.034925937652588 secs.
Printing 100000 of nothing
Exe Time is 0.037981986999512 secs.
Do you need to determine this gap?