http://www.wampserver.com/and install the server.
Run wamp server by this selction
start->All programs->Wamp server->Start wamp server
Now you can see the w icon in system tray.
Let us create our php file first.
Open notepad and type the php code.
save the file inside this folder
c://wamp/www/also you can create folder inside this folder to more specific.
Let us assume i have stored Testing.php
Step 4: Start the server
Left click on the wamp icon in system tray.
It will display list of options.
Select "start all services".
Now all services(especially php) is running.
Open the mozilla and type localhost in address bar.
It will show the default page of wamp server.
Now include this Testing.php (my php file name) at the end of the url
It will run your php file.