PHP stands for: PHP Hypertext Preprocessor. Yes, the P in PHP stands for PHP. It’s a “recursive” acronym, but this isn’t terribly important to know. More important than what it stands for, is what it actually is. PHP is an open-source, server side scripting language. There are three components to that definition, and it’s important to make sure we have a general understanding of what each of these mean.
First, the development and usage of PHP is open source, as opposed to private and licensed, like Java. This means that the source code for PHP is available to the public, essentially allowing anyone to modify and use it without paying any sort of associated fee. PHP is developed and maintained by The PHP Group, but developers or companies do not need to pay a licensing fee to that organization in order to utilize the language.
Second (and jumping out of order a bit) PHP is a scripting language. A scripting language is similar to any other programming language both syntactically and semantically, insofar as they are generally derived from more robust programming languages. The difference is that a scripting language is used specifically to write scripts (hence the name…), which are automated commands designed to carry out specified tasks that a human would otherwise do manually. This makes a scripting language ideally suited for development on dynamic webpages, which is what PHP is predominantly used for. Scripting languages are run on scripting engines, with the Zend engine being the primary engine for PHP5, which is the most current version of PHP, originally introduced in 2004.
And Finally, PHP is a scripting language that operates on the server side. We speak often of front end languages and back end languages, but in reality the languages themselves operate in the middle of these two “ends”. The distinction comes with which end the language interacts with, so server side and client side, or browser, might be a more appropriate classification. PHP retrieves data from the server on the back end of a system, and then returns that information to the browser, imbedded in HTML code so the browser can interpret and display it.
So this is essentially what PHP is. But when building a new website, a developer is presented with a variety of languages as potential options, many of which could fit the same above definition. So what are the pros and cons of using PHP? The pros of using PHP are that it is considered to be the cheaper alternative. (And it is cheaper, for reasons mentioned earlier.) Its source code is available free of licensing fees, so it is inherently cheaper than, say, Java. But it would be a misconception to assume that using PHP is free. The server on which you actually run the program costs money regardless of the language used, and maintenance fees would still apply. So the cost factor is a plus for PHP, but not a major one. PHP can also be run on any modern server, making it versatile and therefore a valuable language to learn.
By and large, the major pros and cons for using PHP revolve around the same observation: PHP enjoys extremely wide usage, both because it is comparatively simple to learn and there is an abundance of available information to reference online. On the plus side, this means there is a lot of modified code ready to use and available to the public, and it is easy to research solutions to any number of problems. There is a vibrant and active PHP community that attracts developers looking to play an impactful role in something bigger than themselves. On the flip side, this means that there is a lot of bad code available, and a lot of sub-par programmers using the language. There is a stigma that because it is easy to learn, and because there is so much information readily available, the language attracts programmers that aren’t quite as serious or formally trained than programmers of other languages. Also, the negative side of there being so much information available online is that some of the information is unreliable (Don’t believe everything you read on the internet!). Of course this isn’t always the case, but the stigma persists.
A special note should be made regarding security. PHP is generally considered to be less secure than Java. This seems to be a function of the negative stigma associated with PHP developers in general. In reality, there is nothing inherently insecure about the language, but code written clumsily by inexperienced programmers can be very insecure, according to Keith Casey, interviewed by Mashable.