Write a program to print “Hello World” using echo
Description: Write a PHP program to print “Hello World” using echo only.
Rules and hints:
- You can not use any variable.
- End every statement with a semicolon.
PHP program to print Hello World
<?php
echo "Hello World";
?>
Output:
Tutorials Class - Output Window
Hello World
How it works
<?phpand?>are the PHP tags.echoprints the text on the page.- The text is in double quotes, and the statement ends with
;.
Related: PHP Syntax and echo vs print.
Learn more about the similar topics:
| Tutorials |
|---|
| PHP Introduction |
| PHP Terminology |
| PHP Installation |
| PHP Syntax |
| PHP Comments |
| PHP exit() Function |
| Exercises & Assignments |
|---|
| Write a program to print “Hello World” using echo |
| Simple Tips for PHP Beginners |
| Experiment with Basic PHP Syntax Errors |
| Using phpinfo() – Display PHP Configuration & Modules |