March 5th, 2013, 08:26 AM
Difference between print and echo
i have a problem to differentiate print and echo please help me with practical examples.basically i don't understand how print return value?????
March 5th, 2013, 08:34 AM
Virtually none. I think echo may be negligibly faster. Print always returns a value of 1, unlike echo but I don't know what that might be worth.
There are 10 kinds of people in the world. Those that understand binary and those that don't.
March 5th, 2013, 10:17 AM
One is a language construct and the other is a function. You can actually accept the return value of print, unlike echo. However, there's functionally no difference. It's all in how PHP parses it and handles it, they work out to the same thing for most applications.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.
March 5th, 2013, 10:21 AM
None of them is a function, they're both language constructs. The print construct just happens to be an expression, so it yields a value.