Concept Flow - Echo statement
Start PHP script
Evaluate expression
Send output to screen
Continue or end script
The echo statement evaluates the given expression and sends the result directly to the screen, then continues with the script.
<?php echo "Hello, world!"; ?>
| Step | Action | Expression Evaluated | Output Produced |
|---|---|---|---|
| 1 | Start PHP script | N/A | N/A |
| 2 | Evaluate expression | "Hello, world!" | "Hello, world!" |
| 3 | Send output to screen | N/A | Hello, world! displayed |
| 4 | End script | N/A | Script ends |
| Variable | Start | After echo | Final |
|---|---|---|---|
| N/A | N/A | N/A | N/A |
Echo statement in PHP: - Syntax: echo expression1, expression2, ...; - Outputs expressions directly to the screen - Parentheses optional - Can output multiple items separated by commas - Does not return a value