PHP can do anything. PHP is mainly used for server-side scripts, so you can use PHP to complete any work that other CGI programs can do, such as collecting form data, generating dynamic web pages, or sending/receiving Cookies. But PHP’s capabilities go far beyond that.
PHP scripts are mainly used in the following three areas:
PHP can be used on all major operating systems, including Linux, various variants of Unix (including HP-UX, Solaris, and OpenBSD), Microsoft Windows, Mac OS X, RISC OS, etc. Today, PHP already supports most web servers, including Apache, Microsoft Internet Information Server (IIS), Personal web Server (PWS), Netscape, iPlant server, Oreilly Website Pro Server, Caudium, Xitami, OmniHTTPd, etc. For most servers, PHP provides a module; some PHP supports the CGI standard, allowing PHP to work as a CGI processor.
To sum up, using PHP, you can freely choose the operating system and web server. At the same time, you can also choose to use process-oriented, object-oriented, or a mixture of the two during development. Although PHP 4 does not support all OOP standards, many code repositories and large applications (including the PEAR library) are developed using only OOP code. PHP 5 makes up for this weakness of PHP 4 and introduces a complete object model.
With PHP, you are not limited to outputting HTML. PHP can also be used to dynamically output images, PDF files and even Flash animations (using libswf and Ming). It is also possible to easily output text such as XHTML and any other form of XML file. PHP can automatically generate these files, open up a cache of dynamic content on the server, and print them out directly, or store them in the file system.
One of the most powerful and notable features of PHP is its support for a wide range of databases. Users will find it incredibly easy to write database-backed web pages using PHP. Currently, PHP supports the following databases:
There is also a database abstraction extension library called PDO that allows you to freely use any database supported by the extension library. In addition, PHP also supports ODBC, the Open Database Connection Standard, so it can connect to any other database that supports this world standard.
- Adabas D
- dBase
- Empress
- FilePro (read only)
- Hyperwave
- IBM DB2
- Informix
- Ingres
- InterBase
- FrontBase
- mSQL
- Direct MS-SQL
- MySQL
- ODBC
- Oracle (OCI7 and OCI8)
- Ovrimos
- PostgreSQL
- SQLite
- Solid
- Sybase
- Velocis
- Unix dbm
PHP also supports services utilizing protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM (Windows environment) and countless others. Raw network ports can also be opened so that any other protocol can work together. PHP supports WDDX complex data exchange between all web development languages. Regarding interconnection, PHP already supports instant connections to Java objects and can freely use them as PHP objects. You can even use our CORBA extension library to access remote objects.
PHP has extremely efficient text processing features, supporting everything from POSIX extensions or Perl regular expressions to XML document parsing. To parse and access XML documents, PHP 4 supports SAX and DOM standards, and you can also use the XSLT extension library to transform XML documents. PHP 5 standardizes all XML extensions based on the powerful libxm2, and adds SimpleXML and XMLReader support, expanding its capabilities in XML.
In addition, there are many other interesting extension libraries. For example, mnoGoSearch search engine function, IRC gateway function, various compression tools (gzip, bz2, zip), calendar conversion, translation...
Since it is impossible to list all the features and conveniences provided by PHP here, please refer to the installation and function reference chapters for more information about the extension libraries mentioned here.