Figure F-1. PHP development timeline with usage
Its simplicity is what made PHP so successful. Simplicity equals less code. Developers and companies have been developing projects with PHP in a fraction of the time it would take another language.
The future of PHP looks very bright. Leading platform vendors such as IBM, Oracle, MySQL, Intel, and, most recently, Red Hat have all endorsed it. The new Collaboration Project initiated by Zend Technologies rallies many leading companies and community members around new open source initiatives aimed at taking PHP to the next level by creating an industrial-grade, de facto standard PHP web application development and deployment environment. The Project's first two open initiatives are:
Zend PHP FrameworkThis is a web application framework that will accelerate and improve the development and deployment of mission-critical PHP web applications.
Support for the Eclipse Development platformZend is joining the Eclipse Foundation as a Strategic Developer. It will develop, in collaboration with partners, a PHP IDE based on the Eclipse platform.
Rasmus Lerdorf, the initial creator of the first version of PHP (then called PHP/FI), and Kevin Tatroe provided the guidelines for this book. The newest author on the revision project is Peter MacIntyre, a Zend Certified Engineer with more than five years experience in PHP. Wez Furlong and Chris Shiflett have also contributed to this book. Wez modernized the "Extending PHP" chapter, and Chris brought his renowned expertise in updating the "Security" chapter.
This book is a must-have for anybody working with PHP. Some of the most recognizable names in the PHP community have contributed to it. So you know that you are getting quality information. It covers all of the important PHP topics, plus unique issues such as extending and securing PHP, and discusses newer features of XML and Objects and PDO.
-- Michel Gerin Vice President, MarketingZend Technologies, Inc., the PHP Company |
Preface
Now more than ever, the Web is a major vehicle for corporate and personal communications. Web sites carry satellite images of Earth in its entirety, search for life in outer space, and house personal photo albums, business 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 the Web and continues its phenomenal growth with recent endorsements by IBM and ORACLE corporations (to name a few). Also, 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. Marc Andreessen, chairman of Opsware Inc. and founder of Netscape Communications, recently described PHP as having replaced Java as the ideal programming language for the Web.
The core PHP language (Version 5+) features powerful string- and array-handling facilities, as well as greatly improved 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 Cfor 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 it, 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
PHP is a melting pot of cultures. Web designers appreciate its accessibility and convenience, while programmers appreciate its flexibility, power, diversity, and speed. Both cultures need a clear and accurate reference to the language. If you are a programmer, then this book is for you. We show the big picture of the PHP language, and 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 will appreciate the clear and useful guides to specific technologies, such as XML, sessions, PDF generation, 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 has been fully revised to cover the latest features of PHP Version 5. We have endeavored to even talk about some of the features that were still on the drawing board while we were writing this edition. One feature in particular is the new PDO database interface that was still in development during our writing, but we felt it important enough to cover in the discussion on databases ().
Assumptions This Book Makes
This book assumes you have 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