What is PHP?

PHP : Pre Hypertext Processor (Previously, Personal Home Page,) It was created originally in 1995 for a method of creating Dynamic web pages.


There are a few things you need to understand before stepping into the world of PHP.

1. Variables
Variables are the structure of PHP they lay the foundation for everything.
A variable is represented by 3 parts.
- $
- Name
- Value

An example would be; $Variable = 1;

Imagine it like this;
A variable is like a piece of paper with a name and a value written on it.
Your paper is the $ sign. The name is after the paper. And then the paper is equal to the value written on it.

2. Echos
Echo's are a method of outputting data. It is the function followed by the string to be outputted.

Example; echo "Hi";


Now we go to the nitty gritty of explaining how PHP works.

PHP codes are executed before the page is displayed, this is why it is now called "Pre Hypertext Processor"

Pre meaning before Hypertext meaning web content and processor, well you get the idea.

The fact that PHP is executed before a page is displayed to the user allows us to preform "Secret" calculations and process's to customize our web page for anything we need.

For example say we had this code on our web page;

PHP Code:
<?php
echo "Hello!";
?>
All the user would see when viewing the web page is;

Code:
Hello!
Even if they view the page source.

Now since this is just simple PHP, I will not go to in depth with the concept of how you create variables or echrds, they where mentioned because they are absolutely needed for the explanation of PHP.