Create and Run the Hello World Program in PHP
A school fair needs a welcome screen at the entrance. Print a greeting first. Seeing the exact words on screen confirms that the saved program ran and sent text to its output.
1. Save the following program as HelloWorld.php.
<?php
class HelloWorld {
public function greetings() {
echo("Hello World");
}
}
$obj = new HelloWorld();
$obj->greetings();
2. Run php HelloWorld.php.
