The authors say they assume a basic level of PHP or programming knowledge, but their idea of basic is very uneven. You'll find much better resources for common tasks online.
Hopefully there are better PHP books out there - I think I'll stick to [the website] for now and get free, detailed help from the PHP community.
It gives problems and solutions to everyday problems that programmers face, and conveniently groups the examples by category, such as strings, arrays, etc.
PHP Developer's Cookbook helped me with many of the tasks that I was currently embarking upon, and looking through its contents helped me find new and better solutions for current and future problems.
A word of warning, however, this book will probably NOT teach you PHP. The categories are not placed in a good order for beginners, but are great for those of intermediate and expert programmers alike. If you are new to PHP, I would say look elsewhere, say PHP Essentials, but I would recommend that you definetely keep this text in mind if you decide to further your PHP skills. Strongly recommended for intermediate and expert PHP programmers.
There is only one shortcoming to this book (with the exception of Julie Meloni becoming Julie "Melon" in the opening section :P), the lack of source code availability. If you want to see the samples in action and play with them, start typing. That's not too bad for most of the 10-30 line snippets, but for things like the basic search-engine code, it's quite tedious. I OCR'd it... but not everyone has that ability. Hopefully SAMS will either get him a CD to include in his book next time or set up some web space for us to grab it.
I needed a good quality book that would extend my PHP knowledge without treating me like an idiot for the first four chapters or wasting my time with high end stuff I'll never use.
I appreciate cookbooks, I have the Perl Cookbook, Perl CGI/Cookbook and a couple of similar C volumes and find they are useful to get me pointed in thie right direction in both method and style. Often, of course, the code I end up with bears little resemblance to the cookbook code but it saves me time. They also provide a large number of examples of how to perform real world tasks with a language which I find an easier way of learning a language than some dry textbook with short snippets of example code.
In the 24 sections this book covers a huge range of tasks, from the simple, such as string manipulation, through to the highly complex such as drawing graphics with GD and outputting XML.
Each section is broken down into a number (the average is about 8 or 9) problems, each problem comes with at least one solution and a discussion. The discussion will often mention other avenues of approach for variations of the original problem as well as detailing the various parts of the solution.
This book is extremely well structured, well written and useful. I would recommend it for anyone already using PHP or intending to do so in the future.
I have read the Wrox Professionals, PHP Bible, Core and New Riders books but this is by far the best.
Once you know the syntax of the language ..., you need a book which can show you examples of usage. I found myself revisiting a lot of my code after reading this book and changing the way I had done things.
First, the excellent Wrox books came out, and now PHP Cookbook, another excellent resource for PHP programmers. The code snippets are useful on their own, and the coverage of the language is very good. I find myself turning to it even to look up basic function calls, because the use of the function often points out approaches (and additional functionality) that I wasn't aware of.
The book and code samples are well-written, my only complaint is that the source code for the recipes aren't available.
Oo the solution for the problem about include_once("DB/standard.php"); is to give the absolute path: include_once("c:/php/pear/db/common.php");
But this shows you how to do lots of tricks with the language, and even if it doesn't cover what you want to know exactly, you should be able to find answers to most questions in it.
But there are a couple of weaknesses that other reviews have not touched on.
The main disappointment is the choice of topics coverered - there are some pretty major omissions.
As others point out, this is not a book for beginners - a fair bit of knowledge is assumed. Yet much space is taken up with very basic topics which are well covered in the introductory texts, such as creating a class or opening a file.
While this has the virtue of completeness, it has reduced the space for detailed coverage of the really tough issues that are beyond the scope of the PHP introductions.
Of the more advanced topics, I particularly liked the database API - this is the most elegant and efficient solution I have seen, and is worth the price on its own. And there is plenty of detail on email handling, socket programming and XML.
But other key topics such as form handling, data validation and user authentication are barely touched on. Given that the built-in facilities for error handling are still poor in PHP4, I was particularly disappointed that this issue is not really addressed. Another weakness is the rather superficial coverage of the challenges of building usable and efficient search facilities.
My other concern is the rather condensed coding style. Comments are pretty thin on the ground, and the local variable names are often cryptic. So you sometimes have to work quite hard to understand what is going on.
Overall, a great contribution to the PHP literature, but not as comprehensive as it might be. Perhaps this could be addressed in the second edition??
"A quick,cheap book which can fulfill your hungry,but lack of extra vitamins". Yes,it is quick.You can find out what u need quickly,especially some simple questions,e.g. converting ascii to html,which you don't want to write a function yourself.Then this book is for you.
Given the size of this book is small,u can't find extra vitamin that is essential to keep your body healthy,youu really need a good intro book,e.g. teach yourself php4 in 24hrs. and a guide book which contains long examples.e.g. shopping cart,discussion borad,e.g. professional php programming from wrox,or php/mysql application from mindware.
1) It assumes you are an experienced programmer. An if you are not then this is not really the best first choice.
2) It is tasked based. In other words you have to define the task in your mind (like I want to invert a character string) and find where it teaches that. So it is laid out in sections labeled 'Problem' and 'Solution'. eg
Problem: I want to locate a record in binary file and update it in place:
Solution: A chunk of code which solves the problem.. ...often more than one way, then an explanation of how an why
3) It is not a true reference. There are no tables of regular expressions, function lists, special symbols etc.
4) If you know PERL then this IS the book for you as it draws frequent comparison and borrows from your perl experience. If you do not then it will be more difficult. (possibly other list based languages would do just as well)
The above are criticisms in the true sense of the word. For me the book is excellent. Incidentally, it's a pig trying to switch backwards and forwards between PERL and PHP. They are JUST different enough that you keep using the wrong syntax - at least I am during these early days.
The layout and general concept of this book is very similar to that other beloved cookbook. Some entries are nearly identical. One feature I adore in particular is multiple recipes for one task, stating which is faster/more efficient, and then telling you why.
I have been scripting PHP for 2 years, mostly professionally, but many fun, personal projects as well. Not only do I wish I had this book, but I am gald that I have it now. I have been reading this thing randomly but voraciously, and I have found little gems even under the elementary topics.
I will be working on 2 major projects soon, the development stage of one has just begun. One is a massive intranet site, (authentication, sessions, customization, etc.) and the other is an ecommerce site/application. I will be using this book continuously as a: 1) code reminder 2) how-to resource 3) code-refiner 4) style-refiner.
I've already used it several times for custom classes - don't pass this one up!