
Chapter 1, “What Is New in PHP 5?” discusses the new features in PHP 5. Most of these new
features deal with new object-oriented features, including small examples for each feature. It
also gives an overview of the new extensions in PHP 5. Most of the topics mentioned in this
chapter are explained in more detail in later chapters.
Chapter 2, “PHP 5 Basic Language,” introduces the PHP syntax to those readers not familiar
with PHP. All basic language constructs and variable types are explained along with simple
examples to give the reader the necessary building blocks to build real scripts.
Chapter 3, “PHP 5 OO Language,” continues exploring PHP 5's syntax, focusing on its
object-oriented functionality. This chapter covers basics, such as properties and methods, and
progresses to more complicated subjects, such as polymorphism, interfaces, exceptions, and
lots more.
Using the previous chapter as a foundation, Chapter 4, “PHP 5 Advanced OOP and Design
Patterns,” covers some of the most advanced features of PHP 5’s object model. After learning
these features, including four commonly used design patterns and PHP’s reflection capabilities,
you will soon become an OO wizard.
Now that you are familiar with the syntax and language features of PHP, Chapter 5, “How to
Write a Web Application with PHP,” introduces you to the world of writing web applications.
The authors show you basics, such as handling input through form variables and safety
techniques, but this chapter also includes more advanced topics, such as handling sessions with
cookies and PHP's session extension. You also find a few tips on laying out your source code for
your web applications.
Chapter 6, “Databases with PHP 5,” introduces using MySQL, SQLite, and Oracle from PHP,
but focuses primarily on the PHP 5-specific details of database access. For each database, you
learn about some of its strong and weak points, as well as the types of applications at which
each excels. And of course, you learn how to interface with them using PHP's native functions
or using PEAR DB. All scripts can throw errors, but of course you do not want them to show up
on your web site once your application has passed its development state.
Chapter 7, “Error Handling,” deals with different types of errors that exist, how to handle
those errors with PHP, and how to handle errors with PEAR. As one of the important new
features in PHP 5 is its renewed XML support, a chapter on XML features in PHP 5 could not be
missed.
Chapter 8, “XML with PHP 5,” talks about the different strategies of parsing XML and
converting XML to other formats with XSLT. XML-RPC and SOAP are introduced to show you
how to implement web services with both techniques. Although not specifically for PHP 5, the
five mainstream extensions that
Chapter 9,“Mainstream Extensions,” covers are important enough to deserve a place in this
book. The first section, “Files and Streams,” explains about handling files and network streams.
A stream is nothing more than a way to access external data, such as a file, remote URL, or
compressed file. The second section, “Regular Expressions,” explains the syntax of a regular
expression engine (PCRE) that PHP uses with numerous examples to show you how these
expressions can make your life easier. In “Date Handling,” we explain the different functions
used to parse and format date and time strings. In “Graphics Manipulation with GD,” we show
you through two real-life scenarios the basic functions of creating and manipulating graphics
with PHP. The last section in this chapter, “Multibyte Strings and Character Sets,” explains the
different character sets and the functions to convert and handle different ones, including
multi-byte strings used in Asian languages.
PHP 5 Power Programming

