+ 2
Print and echo. Difference?
what's the difference between print and echo?
7 odpowiedzi
+ 3
Both use to show output stream data to browser. But, echo is faster than print. Use echo for output single data. For array use print_r()
+ 3
Well, I have not tested it but read on w3schools.com and stackoverflow. it slow because it set a return type. here
http://stackoverflow.com/questions/234241/how-are-echo-and-print-different-in-php
Yes, you are right on I have to write difference like it return 1 and it only work with one argument. But I was in hurry. Sorry, for that. Thanks for accepting that you down vote my answer.
+ 2
hey, if you not get angry then I have a question.
Why you down vote my answer. I don't think it is wrong.
else ignore it if you not do that.
+ 1
There are no major differences between the two, since they are both used for outputing data.
print has a return value of 1, while echo has no return value and echo is said to be marginally faster, although it is not noticeable.
+ 1
Just like manual says : The only difference to echo is that print only accepts a single argument.
http://php.net/manual/en/function.print.php
http://php.net/manual/en/function.echo.php
0
It's because correct answer is just these argumenty - but something that one is faster than another? Have you any tests?
0
echo is faster than print()