Echo VS Print Statement

ECHO:

echo and print are more or less the same.

echo() and print() are language constructs in PHP, both are used to output strings. The speed of both statements is almost the same.

echo() can take multiple expressions

Example:

Print Statement:

The print statement can be used with or without parentheses: print or print().

Print return true or false based on success or failure whereas echo doesn’t return true or false.

print cannot take multiple expressions.

Example:

Related posts