1. Computing & Technology

Discuss in my forum

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.

©2012 About.com. All rights reserved.

A part of The New York Times Company.