In my experience, working with PHP is complicated by the need to run a webserver to test it on. Quite a challenge for a newbie to coding.
I have used a nice little webserver tool for a while called Server2Go. It is freeware, runs quite light and can even be copied to a USB drive if you want to move it around.
To test your PHP code, just place the .php file into the htdocs folder inside S2Go, click the .exe file and away you go.
Hope this helps some of you out there,
Daniel S