Hello World in PHP

LEVEL: Beginner

Whats in this post?

  1. Code
  2. Output
  3. Background and Explanation of the code

Code


To copy code: Click  View Source “View Source” on the right of this code snippet.

Background and Explanation of the code

A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code. Each statement in PHP must end with a semicolon. There are two basic statements to output text with PHP: echo and print. In this program we have used the echo statement to output the text “Hello World”.

Output:
Hello World