1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Hello, World!

The Most Basic Computer Program


Human hands working on a laptop at desk
Neustockimages/E+/Getty Images
Every language has it... the basic "Hello, World!" script. It is a simple script that only displays the words "Hello, World!". Over the years this has become the traditional phrase to use when writing your first program. According to wikipedia, it's mainstream usage spawned from an internal memorandum in 1974 that became incorporated into the book The C Programming Language. It's actual first known usage was in Kernighan's 1972 A Tutorial Introduction to the Language B. From this it has grown into somewhat of a tradition in the programming world.

So how do I do it in PHP? Well the two simplest ways are using Print or Echo.

 Print "Hello, World!";
 Echo "Hello, World!";
To learn more about beginning PHP programming, read our Learn PHP article.
Related Video
Basic PHP Syntax
Using PHP With HTML
  1. About.com
  2. Technology
  3. PHP / MySQL
  4. Learn PHP
  5. PHP "Hello, World!" Basic Print Script

©2014 About.com. All rights reserved.