What is the difference between "echo" and "print" in php? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between "echo" and "print" in php?

19th Jul 2016, 3:30 AM
Digital Saurav
Digital Saurav - avatar
6 Answers
+ 4
Hi, echo and print are more or less the same. They are both used to output data to the screen. The differences are small: echo has no return value while print has a return value of 1 so it can be used in expressions. echo can take multiple parameters (although such usage is rare) while print can take one argument.
19th Jul 2016, 2:31 PM
muydfslgpplv
+ 2
Echo is statement but print is function so echo can't return while print can
21st Jul 2016, 8:25 PM
Mrityunjay Yadav
Mrityunjay Yadav - avatar
0
important difference is echo can not output array data .. but print can
21st Jul 2016, 2:59 AM
Dibya Krushna Das
Dibya Krushna Das - avatar
- 1
difference
19th Jul 2016, 1:36 PM
jetsada
- 1
Echo can print but print can't echo. ;)
19th Jul 2016, 4:09 PM
Devansh Sharma
Devansh Sharma - avatar
- 3
There is no difference
19th Jul 2016, 11:23 AM
Faris Mahroum
Faris Mahroum - avatar