Hi.....
I know echo() and print() use to display any message but I want to know what is the difference between them ? Please explain with an example ?
Thanks......
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 14, 2012, 11:28 AM
1. echo can output multiple strings but print can only output a single string.
2. echo has a void return type but print returns an int though it's always 1.
3. echo has a shortcut syntax but print does not.
For example:
echo 'Hello', ' ', 'World';
print 'Hello World';
Vineet Kumar SainiPosted Feb 14, 2012, 5:13 PM