Introduction
As the Internet continues to evolve, so too does the necessity for a language that addresses
the functionality needs of the Internet’s web viewers. Over time, some programming lan-
guages have come and gone, and others have continued to evolve. Several languages have
moved into the lead in the race for supremacy. Although languages such as ColdFusion,
ASP.NET, and CGI certainly have their advantages, PHP seems to be the developer’s choice
for a versatile, open-source solution.
PHP has grown over the years and, thanks to its devotees, has continued to adopt the
functionality most preferred by its user base. By actually listening to the developers to help
guide PHP’s development path, the PHP creators have introduced some impressive function-
ality over the years. However, PHP 4, while a sound developmental language and tool, was
lacking on a few fronts. For instance, it had a means for developers to take an object-oriented
approach, but several key pieces of functionality were not implemented, such as exception
handling and session support (for objects).
PHP 5 has changed all that. No longer must developers write classes that are missing
functionality. Available to PHP is a full set of object-oriented development tools. Of particular
note in PHP 5 is the ability to protect class variables in several ways. In addition, inheritance
difficulties are now a thing of the past, and exception handling has become a nice way of tak-
ing care of pesky errors and validation.
Thankfully, while PHP 5 has continued to develop, so too have the many extensions
that work alongside it. Several key extensions are bundled with the download package; for
instance, those who follow the MySQL database’s continued evolution will be happy to find
that the new mysqli extension contains a large set of functionality to help you work with
queries in a much more object-oriented way and to help speed up the efficiency of database-
driven web projects.
Further, the process of creating dynamic images has been improved; it is no longer diffi-
cult to install the GD2 library. Instead, it is bundled in PHP 5 from the start. All the bugs from
recent incarnations of the GD library seem to have been dealt with, and creating images using
the PHP 5 engine is simple and effective.
As web developers (and otherwise) continue to see XML as the be-all and end-all of portable
data storage, PHP 5 has gracefully adopted such functionality in the form of Simple XML, which is
a set of easy-to-use, custom-made, object-oriented methods for working with XML.
We could go on and on about the additions to PHP 5 that are getting rave reviews, but it is
much more helpful to actually see such functionality at work. While advancements in technol-
ogy take place every day, it is the actual implementation of such technology that brings
forward movement to the world.
Therefore, to show you some of the new PHP 5 functionality in real-world situations, this
book includes recipes that will allow you to simply drop code into your already custom-built
applications. By covering the vast scope of web applications, this book’s authors—with spe-
cialties in custom applications, database design, and Internet functionality—have devised a
xix
5092_Ch00_FM_FINAL 8/26/05 5:32 PM Page xix