PHP Output

echo and print are PHP statements to output data.

These statements can also be used in parenthesis: echo() and print().

Differences between echo and print:

  • echo is faster than print.
  • echo can accept multiple parameters while print can only accept.
  • echo has no return value while print has a return value of 1.

Both statements can also be used to output the value of variables.

Do It Yourself

  Do It Yourself

What You Should Know at the End of This Lesson

  • You should know about the two basic output statements.
  • You should know about the differences between them.