PHP Cookbook
Tuesday, 19 October 2004 @ 16:53Learning by examples and solutions of others is a fast way to understanding, and great code. The PHP Cookbook covers many topics, but hits hard on those topics that are so often used in the PHP world. Each chapter contains several solutions. They are presented by describing the problem, listing the example code for the solution, then it details a discussion of this particular solution and how it might be customized for your personal project. It begins with simple, but often used solutions like strings, numbers, dates and times, and arrays. After covering these important peices, it covers the more complicated tasks that many PHP programmers had to fight through the first few times like web automation, XML, encryption, images, and internationalization.
While much of this book will help beginners, it’s focus is on intermediate programmers that might need some well thought out solutions to common problems, as well as good ideas on how to approach a custom solution. I recommend this book to any PHP programmer looking for new ideas, good solutions, or even a simple reminder of some cool stuff PHP can do.
What I liked
The PHP Cookbook had many examples that showed me functions that I haven’t tried, or have forgotten. These include:
- fgetcsv()
- pack() and unpack()
- wordwrap()
- mt_rand()
- Pear DB/Pager
- Pear Auth
- Reading directories
- PHP GTK
- and so much more
The PHP Cookbook also makes a great reference book, because it is well organized, has a detailed table of contents, and a great index. Parts that are critical when you need to find out how to find a specific topic.
What I would like to see improved
Personally, I would like the first half of the book to be a bit lighter. I mentioned that this book seems geared toward intermediate programmers, and we don’t really need a rehash of some really simple topics like strtoupper, ucfirst, exponents, logarithms, explode, in_array, etc. I would like more of this precious paper be used for more topics.
PHP Cookbook, 1st Edition
Author: David Sklar, Adam Trachtenberg
ISBN: 1-56592-681-1
Publisher: O’Reilly
Published: November 2002
Pages: 632
Rating: * * * * *