PHP echo VS print
I noticed a lot of people use echo instead of print when using PHP. Why?
I see the differences for echo vs print
echo -- Output one or more strings
print -- Output a string
To me, it makes sense to use echo only when outputting more than one string.... But why? Why not just do
print "hello" . "there";
Why not?
Started by Crane, Jun 13 2006 03:18 PM
4 replies to this topic
#1
Posted 13 June 2006 - 03:18 PM
|
|
|
#2
Posted 13 June 2006 - 04:17 PM
I really do not know. I use echo just because it was the way I was taught. I think print and echo are almost interchangable.
#3
Posted 14 June 2006 - 01:24 PM
print is a basic command. alot of the commands in php have dups, to make it easier to migrate from one languge to another. For example alot of c commands have been added to php, even though a php alternative already existed for it.
#4
Guest_Chicken_*
Posted 14 June 2006 - 05:05 PM
Guest_Chicken_*
Well echo is shorter then print, lol.
#5
Posted 14 June 2006 - 05:09 PM
lol by one characeter :(


Sign In
Create Account


Back to top









