UKUUG home


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






Book Discounts

Other Discounts

Mailing lists






PHP Hacks

Jack Herrington
Published by O'Reilly Media
464 pages
£ 20.99
Published: January 3, 2006
reviewed by Alain Williams
   in the June 2006 issue (pdf), (html)

My feelings on this book are mixed.

There is a lot that is not so much about `PHP Hacks' but tips in an environment where PHP may be used. For instance: Hack 60 is all about Apache's mod_rewrite, useful and a good summary, but not much to do with PHP. Hack 5 is about using CSS to create HTML boxes, wrapped up in some PHP code. Much of the code has little or no comments, the adjacent text is only sometimes really enlightening.

The author uses some PHP-specific concepts such as output buffering (ob_start()): it would be nice if he had taken the opportunity of making this a real PHP Hack and explained why he used them since many people will have overlooked this PHP functionality.

Hack 87 `Build GUI Interfaces with GTK' I thought was really interesting -- let's use PHP with a GUI but not in a web environment, this will break new ground for me. Unfortunately the description of what it doesn't really tell me how it works and points to a URL where I can get more information. A whole chapter of Hacks on this would have been great. The previous Hack on Custom Maps with MapServer is much better, well written background, concepts and code with comments.

There is some use of PEAR modules, this is welcome since PEAR is notoriously badly documented. I similarly liked Hack 68 `Create Objects with Abstract Factories' and the ones that followed, Hack 36 shows PHP5's __call, __set and __get with some nice explanations and diagrams. I can write and use simple objects -- these will help me get my head round more OO ideas.

The chapter on graphics is worth reading if you want to see how to manipulate images (e.g. scale them) or drawing graphs. Also useful are some scripts that implement a login system, many people seem to find this a difficult thing to get off the ground. This is database independent (using PEAR DB), he includes MySQL table definitions and sample user entries so it is quite a complete example.

Similarly creation of a simple shopping card (Hack 66) is covered but there are no comments and not a lot of description of the PHP or JavaScript. It would have been nice if this had been integrated with Hack 62 which is a, well written, description of a PayPal `Buy Now' button.

Most of the book would be better titled a PHP Cookbook since I expect ``Hacks'' to tell me things about the language that I may find hard to understand or demonstrate neat tricks that are peculiar to the PHP language; there is some of that but a lot which is neat snippets that happen to be written in PHP; and some that belongs elsewhere.

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.