PHP Hacks by Jack D. Herrington
December 2005, O’Reilly Media, Inc.
468 pages, $29.95, paperback
Amazon.com | Amazon.co.jp
From generating Flash movies on the fly to adding interactive maps to your Web site, the number of interesting things that can be done with PHP is limited primarily by one’s imagination. To provide some stimulation on that end, Herrington has picked 100 nifty things you can do with PHP and brought them together in PHP Hacks from O’Reilly.
Like the other titles in the Hacks series, this book contains a smattering of just about everything, but treats the reader to just enough information about each topic to serve as a springboard for further exploration on your own. Although the code samples are quite generous (in many cases, they could be adapted to your own projects with minor alterations), they are clearly intended as a staring point, not as finished, production-ready scripts. In many cases, Herrington also provides well prepared UML diagrams to go along with the code samples, which provide an intuitive visual complement to the code itself.
Although there is certainly a lot of good information and inspirational value in the book’s first four chapters (Installation and Basics, Web Design, DHTML,and Graphics), in my view the really good material is in the last six chapters (Databases and XML, Application Design, Patterns, Testing, Alternative UIs, and Fun Stuff). The material in the chapter on design patterns, in particular, was excellent and would very likely challenge the skills of all but the most experienced PHP developers.
In some cases, though, the content of this book may be a little bit too close to the bleeding edge of what is possible with PHP. I could not help but notice that many of the hacks required PHP5 or the latest versions of Microsoft Office applications, whereas in many production environments (including this server, in fact), PHP4 is still widely used, and many office environments have more or less standardized on the features that were available in Office 2000.
Another thing that may surprise some readers is that, contrary to the regular “copy this code to your server and then load that page in your browser” technique used in many PHP books, many of the hacks in this book are actually designed to run from the command line, which some might find unusual for PHP, which is often thought of as simply an “HTML scripting language.” When shown the command line hacks—and the one for creating desktop applications in PHP—I think most readers will quickly realize that there is more to PHP than just Web pages.
Recommended for anyone who is interested in PHP, but needs a bit of a creative nudge to get started on some truly interesting projects.