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 Variables |