PHP echo Statement
The echo statement can output one or more strings. In general terms, the echo statement can display anything that can be displayed to the browser, such as string, numbers, variables values, the results of expressions etc.
Since echo is a language construct not actually a function (like if statement), you can use it without parentheses e.g. echo or echo (). However, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.
Display Strings of Text
The following example will show you how to display a string of text with the echo statement:
Display HTML Code
The following example will show you how to display HTML code using the echo statement:
The following example will show you how to display variable using the echo statement: