PHP echo

In PHP to print output echo statement is use.
PHP echo is use to print string, escaping characters, variable values.
The echo statement can be used with or without parentheses: echo or echo().

Syntax for echo:




In above program we see the echo statements inside double quotes (” “) will print value of variable.
Whereas, echo statements inside single quotes(‘ ‘) will print as it is.

echo is used to print variable, variable value, text, statement, multi-line statements, escping characters etc.

PHP echo: print variable value


PHP echo: print statement


PHP echo: print multi-line statements


Help others by sharing the content!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.