1. Home
  2. Computing & Technology
  3. PHP / MySQL

Hello, World!
The Most Basic Computer Program

By , About.com Guide

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.

<?php
Print "Hello, World!";
?>
<?php
Echo "Hello, World!";
?>
To learn more about beginning PHP programming, read our Learn PHP article.
More PHP / MySQL Quick Tips
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Learn PHP
  5. PHP Hello World - PHP Hello Script - PHP Print Hello

©2009 About.com, a part of The New York Times Company.

All rights reserved.