PHP is an open-source server-side scripting language widely used in web development. Use this tag for questions about PHP functions, syntax and use.
PHP: Hypertext Preprocessor is a widely used, general-purpose server side scripting language that is especially suited for web development. The latest stable release, development changes, and development branches can be found on the PHP website.
PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP is now installed on more than 20 million websites and 1 million web servers. Originally created by Rasmus Lerdorf in 1995, the reference implementation of PHP is now produced by The PHP Group. While PHP originally stood for Personal Home Page, it is now said to stand for PHP: Hypertext Preprocessor, a recursive acronym.
PHP code is interpreted by a web server with a PHP processor module which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. It has also evolved to include a command-line interface capability and can be used in standalone graphical applications.
PHP has many active community forums, including:
The PHP manual is the official documentation for the language syntax, featuring function search and URL shortcuts (for example https://secure.php.net/explode). The API is well documented for native and additional extensions. Most additional extensions can be found in PECL. The PEAR repository contains a plethora of community supplied classes.
Free PHP Programming Books
- PHP Essentials
- Practical PHP Programming (wiki containing O'Reilly's PHP In a Nutshell)
- Zend Framework: Survive the Deep End
- PHP: The Right Way (is a community driven quick reference for PHP best practices and accepted coding standards)
Best PHP Books 2012
- PHP Solutions: Dynamic Web Design Made Easy
- PHP and MySQL Web Development (4th Edition)
- Murach's PHP and MySQL (Murach: Training & Reference)
- PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
PHP supports a wide range of databases, relational and non-relational alike.
PHP is often paired with the MySQL relational database. PHP also includes great database support for PostgreSQL, SQLite, Microsoft SQL Server (API reference), Oracle, IBM DB2 & Cloudscape, Apache Derby and even ODBC.
All modern versions of PHP include PDO, a built-in data-access abstraction library with comprehensive connectivity options. More recently, PECL extensions have surfaced that offer "NoSQL" database support, including Apache Thrift (for Apache Cassandra), MongoDB, Redis, and others.
Useful Third-party Code and Tools
In addition to the vast functionality provided in the PHP Core and through PEAR and PECL, there are a number of noteworthy 3rd party contributions to the PHP world, some of which are listed below.
PHP has a variety of object-oriented web application frameworks that provide a lot of the common functionality required to build modern web application out of the box, with the more well-known being (in alphabetical order) the following ones:
- Zend Framework
- Zeta Components (formerly ezComponents)
- xAjax (simplifies AJAX programming using PHP)
- more …
Object relational Maps try to solve or mitigate the object-relational impedance mismatch problem by transparently mapping between table structures in a database and business objects in an application. The more prominent ORMs in the PHP world are (in alphabetical order):