PHP print Keyword
Definition and Usage
The print
keyword is used to output a
string.
The print
keyword always returns 1.
echo
and print
are more or less the same. They are both used to output data
to the screen.
The differences are small:
echo
has no return value, whileprint
has a return value of 1 so it can be used in expressionsecho
can take multiple parameters, whileprint
can take one argumentecho
is marginally faster thanprint
Related Pages
The echo
keyword
❮ PHP Keywords