What is PHP?
PHP: Hypertext Processor, But What is it?
PHP is in use all over the Internet, but what exactly is it? This article should answer that question and many more.
What Is PHP?
PHP, which stands for "PHP: Hypertext Preprocessor", was created in 1994 by Rasmus Lerdorf as a way to track visitors to his online résumé (although then it stood for "Personal Home Page").
According to the official PHP website (www.php.net), PHP is "an HTML embedded scripting language". What this means is that PHP can be used in conjunction with HTML, which makes developing dynamic web sites a lot easier. This description also states that PHP is a scripting language, not a programming language. PHP was designed to create web scripts, not stand-alone applications. The script will only run when a user does a certain action, such as visit a URL or submit a form.
PHP is server-side cross-platform technology, with both descriptions being of equal importance. Server-side means that everything PHP does occurs on the server, as apposed to the client machine which is where languages such as JavaScript and AJAX run. Cross-platform means that PHP can run on most operating systems, including Windows, Unix (and it’s many variants) and Macintosh. More importantly, scripts on one server should require little to no modification when moved to a different server.
Why Use PHP?
Essentially, when it comes to developing dynamic web sites, PHP is better, faster and easier to learn than the alternatives such as ASP or ColdFusion. With PHP you get an excellent performance, portability, stability, the ability to link with almost all database technologies and an infinite selection of features thanks to its extendibility. All this comes at no charge to anyone (PHP is open source) and a very manageable learning curve.
Finally, the proof is in the pudding: since it’s inception it has seen exponential growth and has become the most popular scripting language available. It is the most requested module for Apache, the most-used web server. At the time of writing, PHP was in use on about 20 million domains.
How Does PHP Work?
As mentioned earlier, PHP is side-server meaning that scripts in PHP reside on a host computer know as a server. A server will send the web pages to the requesting visitors (you, the client, and your web browser).
When a visitor loads a website written in PHP, the server will read and process the PHP code according to the scripted instructions. In Figure 1 the PHP script tells the server to send the appropriate data (the HTML) to the client’s web browser which will treat the code as it would a standard HTML page.
Figure 1:

Figure 2 shows the process of a static HTML page. The server merely receives the request and sends the HTML data to the web browser with no side-server interpretation. Hence, to the end user there will be no perceivable difference between what home.html and home.php may look like; however the way the page’s content was created will be significantly different.
Figure 2:

More Information
Reprint Rights
If you wish to link to this article, you are free to do so. If you wish to copy this article or any part of it onto your own site, a link from your website to ours is required. Please ensure that all links to this site point to http://www.stuff4web.co.uk.
