echo
Prints to the screen.
Syntax
echo value;
Description
The main way to output in PHP. Writes text, numbers, or variables to the screen. You can provide multiple separated by commas.
Example
Loading editor…
Expected output
Hello World
When to use?
Generating HTML, showing results.
Common mistakes
- ⚠️ A semicolon (;) is required after every statement.