Do you know how PHP works? If not, then understand that first. Let me give you sone small explanation
1. A server receives request for a .php page
2. It hands it over to the PHP interpreter which goes thru the code
3. It gives the output of the code in HTML
4. The HTML output is sent to the browser.
Why use PHP? Here's an (silly) example. If you want to display numbers from 1 to 100 one below the other on HTML page, then without PHP you will write it like this
Code:
1<br>
2<br>
3<br>
...
...
100<br>
With PHP you will write it like this
Code:
for ($ctr = 1; $ctr <= 100; $ctr++)
{
print($ctr . "<br>");
}
So three lines in place of 100 and if it changes to 1000, just one more 0 in the counter will do the job, whereas in HTML you will have to write 900 more lines. Additionally, there are certain things which can't be done in HTML properly e.g. dynamic pages. For example, have a look at *www.deitydarshan.com. Just ignore the pathetic looks as it will be changed within 10 days. I have coded this site in PHP. I made a few pages and those same pages keep displaying the images day after day and even previous days/years. This site is running since July 2005 with the same set of PHP pages
For testing and writing PHP pages, you need to install Apache and PHP in your machine. You can either install them separately and connect them. Or directly download and install XAMPP or EasyPHP. These two softwares will configure everything in your machine automatically.
Also download some tutorials from the net for PHP. *w3schools.com will give you some basics. Search for e-books on the net. There are many legal (and illegal) e-books available for download. You can also download PHP Manual. These days, I refer to this manual the most then any other book