Echo (PHP) vs Print (PHP)
Comparison chart
| Echo (PHP) | Print (PHP) |
Parameters: | echo can take more than oneparameter when used without parentheses. The syntax is echo expression [, expression[, expression] ... ]. Note that echo ($arg1,$arg2) is invalid. | print only takes one parameter. |
Return value: | echo does not return any value | print always returns 1 (integer) |
Syntax: | void echo ( string $arg1 [, string $... ] ) | int print ( string $arg ) |
What is it?: | In PHP, echo is not a function but a language construct. | In PHP, print is not a really function but a language construct. However, it behaves like a function in that it returns a value.
|
No comments:
Post a Comment