Home » Programming » php » Echo and print Statements

Echo and print Statements

There are two types in PHP by which we can generate output, one is echo and another is print. They are exactly same working but they both have some similarity that echo do not have any return value but print have return value 1. And because of that print can be used in expressions. Echo is very fast as compared to print. It can take multiple arguments but echo can take only one arguments.

1. Echo:
It can be used with or without the parenthesis.
Example:

Result:

PHP!
I’m human being!
This is new way to learn many new things.

2. Print:

It can also be used with or without parenthesis.

Example:

Result:

PHP!
I’m human being!
This is new way to learn many new things.

Please follow and like us:
error

Leave a comment

Your email address will not be published.