# Part 2.1An introduction to PHP

## What is PHP?

PHP originally stood for Personal Home Page, but latterly it became known as PHP Hypertext Preprocessor, a recursive acronym.

PHP is a server side scripting language. This means that the server which hosts the page will do the processing of the PHP. The client will never see the PHP code that is used to display the page because the server produces a page which no longer has PHP code but just has HTML. PHP is great because it can manipulate the HTML before the client sees it, contrast to JavaScript which works on the client side and manipulates the DOM (Document Object Model).

PHP can also be used to serve as a method of accessing information on forms, an important part of online shopping.

## Getting started

PHP requires some kind of interpreter on the server or local machine. One such example is XAMPP, which also includes phpMyAdmin and MySQL.

## Extra requirements of PHP

PHP absolutely requires the .php file extension or a file extension which has the PHP MIME file type associated with it to inform the PHP server what it is looking at or that the server understands that a certain file is to be processed as PHP.

PHP also requires installation on the server, so it is not possible to just run PHP on a local machine without the proper server software such as Apache (there are complete packages that include server applications such as MAMP).

## Opening and closing a PHP code block

PHP when it is included in a page is included as a code block, just as JavaScript is. PHP is enclosed as follows:

PHP
<?php

?>


## What does PHP look like?

The following code sample shows how PHP integrates into HTML:

HTML + PHP
<!doctype html>
<html>
for($i = 0;$i < 10; $i++){ echo "<p>" .$i . "</p>";