PHP is a general-purpose scripting language that is especially suited to server-side web development, in which case PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content or dynamic images used on websites.
There are several different scripting languages developers have to choose from when building applications such as ASP, JPS, Perl, CGI, and PHP. The main debate recently has been between PHP and ASPX, but it's hard to argue against the popularity of PHP.
When comparing PHP to a language such as ASPX, the level of freedom you get is far superior. You can use any text editor in order to code PHP such as Notebook++, jEdit, Emacs, Bluefish, or even just Notepad if you feel inclined. If you want to develop applications with ASPX, you're going to be limited to Microsoft Visual Studio. Restrictions are never a good thing, especially with coding.