PHP is a server-side processing language for web pages: that is, it processes code contained with PHP tags, displaying the result in the browser or doing something else with the information (storing it in a database, sending it via eMail, etc). Developed in 1994 by Rasmus Lerdorf, the PHP acronym stood for “Personal Home Page”, later changing to “PHP: Hypertext Processor”, one of the self-referential acronyms that plague the IT industry. Personally, I prefer Pre-Hypertext Processor, to make it clear that PHP runs before anything else on the page.
PHP is one the most powerful technologies available to web developers, having six major advantages:
- It is free and open source.
- PHP is developed and maintained by a loose, world-wide collaborative group of software engineers and coders. Help for PHP is freely available (the best and primary resource being www.php.net). PHP isn’t proprietary to any one company: it is maintained by collective interest, not for profit. Apache and MySQL, the most popular server and database solutions, are also free and open source.
- It can be interweaved with HTML and CSS.
- Since anything outside a
<?php ?>tag (the opening and closing tags of PHP, respectively) is interpreted as HTML, you can create static elements in HTML and interweave dynamic elements in PHP, all on the same page.
- It is cross-platform.
- Because it is interpreted by the server, not the client, PHP is not subject to the vagaries of interpretation by different browsers/platforms, etc. Once PHP runs correctly on a page, it will run the same forever, assuming that the server itself does not change.
- PHP is expressly designed to create dynamic content for web pages.
- Unlike Perl and other languages, PHP was designed for the web “from the ground up”.
- The end user never sees PHP code.
- It is relatively easy to use and learn.