Wednesday, December 28, 2011

basic questions and answers

What is the difference between echo and print?

One difference is that echo() can take multiple expressions
Print cannot take multiple expressions. That is the main distinct difference!

The echo() function is not actually a function, so you are not required to use parentheses with it. However, if you want to pass more than one parameter to echo(), using parentheses will generate a parse error.

The echo() function is slightly faster than print().

The echo() function has the shortcut syntax as echo.

No comments:

Post a Comment