Preface

Now, more than ever, the Web is a major vehicle for corporate and personal communications. Web sites carry photo albums, shopping carts, and product lists. Many of those web sites are driven by PHP, an open source scripting language primarily designed for generating HTML content.

Since its inception in 1994, PHP has swept over the Web. The millions of web sites powered by PHP are testament to its popularity and ease of use. It lies in the sweet spot between Perl/CGI, Active Server Pages (ASP), and HTML. Everyday people can learn PHP and can build powerful dynamic web sites with it.

The core PHP language features powerful string- and array-handling facilities, as well as support for object-oriented programming. With the use of standard and optional extension modules, a PHP application can interact with a database such as MySQL or Oracle, draw graphs, create PDF files, and parse XML files. You can write your own PHP extension modules in C—for example, to provide a PHP interface to the functions in an existing code library. You can even run PHP on Windows, which lets you control other Windows applications such as Word and Excel with COM, or interact with databases using ODBC.

This book is a guide to the PHP language. When you finish this book, you will know how the PHP language works, how to use the many powerful extensions that come standard with PHP, and how to design and build your own PHP web applications.

Audience for This Book

PHP is a melting pot of cultures. Web designers appreciate its accessibility and convenience, while programmers appreciate its flexibility and speed. Both cultures need a clear and accurate reference to the language.

If you’re a programmer, this book is for you. We show the big picture of the PHP language, then discuss the details without wasting your time. The many examples clarify the explanations, and the practical programming advice and many style tips will help you become not just a PHP programmer, but a good PHP programmer.

If you’re a web designer, you’ll appreciate the clear and useful guides to specific technologies, such as XML, sessions, and graphics. And you’ll be able to quickly get the information you need from the language chapters, which explain basic programming concepts in simple terms.

This book does assume a working knowledge of HTML. If you don’t know HTML, you should gain some experience with simple web pages before you try to tackle PHP. For more information on HTML, we recommend HTML & XHTML: The Definitive Guide, by Chuck Musciano and Bill Kennedy (O’Reilly).

Get Programming PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.