How to do "Hello, World!" in PHP.
<?php echo 'Hello, World!'; ?>
Even though PHP is mostly used for adding server-side functionality to web pages, PHP is actually a self-containing language that can be run on a lot of different platforms, both in a web server and completely stand-alone. When PHP is run inside a web server, the echo function renders output to the response of an HTTP request. When PHP is run from the command line, it prints to the console.
For more "Hello, World!" examples, go to the Hello World category.