UKUUG home


(the UK's Unix & Open Systems User Group)






Book Discounts

Other Discounts

Mailing lists






PHP Cookbook

David Sklar and Adam Trachtenberg
Published by O'Reilly Media
810 pages
£ 31.99
Published: 8th September 2006
reviewed by Alain Williams
   in the December 2006 issue (pdf), (html)

I come at this from the point of view of having used the 1st edition of this book by the same authors, published in 2003. Obvious differences are that the new book is 784 pages in 26 chapters (up from 608 and 21) and covers PHP5, but the iguana on the front cover does not appear to have aged.

Some of the recipes are simple things easily found from the on-line PHP manual, eg the discussions of date() and file_exists(); far more useful are the ones where different pieces are drawn together, for example: storing md5 hashes of a password in a database and the corresponding check at login; or reading mail with IMAP or POP3. Something that can be easily found in the manual index has no place in a book like this, especially when they are common to many programming languages. Fortunately there is much in this book that avoids that trap, just skip over much of the chapter on arrays.

Some of the recipe titles are obscure. For instance ``Introspecting Objects'' could be much better understood in an index as ``Inspecting Objects' properties and methods''.

As expected the chapter on objects is expanded, there are lots of recipes that illustrate new magic such as __sleep() and __set(). If you are new to PHP5 it would be worth reading this chapter all through rather than dipping in from the index.

There are two new chapters on Web Services from the point of view of Clients and Servers. This has become trendy and there are a lot of new PHP5 features for SOAP, and XML; most of the discussion here is about SOAP.

There is a new chapter on security, this is welcome given the unfortunate frequency that PHP scripts seem to appear in the bugs lists. Although useful I feel that more good practise could have been said; but I suppose that O'Reilly have Chris Shiflett's book on PHP security.

The chapter on Error Handling, Debugging and Testing is also new. This covers PHP5's exceptions (try, catch), stack traces, control of error logging, testing and debugging.

Regular expressions is a new chapter. The other chapters have been updated with new recipes alongside the old ones.

As is common in a book like this there are long chunks of (downloadable) code sometimes, unfortunately, without internal comments -- come on guys, you are trying to be helpful to your readers here!

There are a few tit-bits for system administrators as well such as a new discussion on compiled code-caching accelerators and ab for Apache benchmarking in a chapter on performance tuning and load testing -- although it leaves a lot unsaid.

Summary: overall it is useful, if you are into PHP -- buy it.

Back to reviews list

Tel: 01763 273 475
Fax: 01763 273 255
Web: Webmaster
Queries: Ask Here
Join UKUUG Today!

UKUUG Secretariat
More information

Page last modified 02 Apr 2007
Copyright © 1995-2011 UKUUG Ltd.