rank trend

PHP Cookbook (Cookbooks (O'Reilly))

by Adam Trachtenberg, and David Sklar
Released 2006-08-25
Read articles about PHP
Buy it from AmazonNew for $29.69

36 Reviews

Sort by: Most Helpful ▲ Date Rating

4 stars ORA Cookbook Vs. WROX Solutions

2002-12-16     113 of 122 found this review helpful

I ordered a copy of the "PHP Cookbook ORA", along with a copy of the "Professional PHP 4 web Development Solutions WROX". Upon reading both these books, i thought i should offer a honest review comparing the two:

Both the books were informative in their own right

o The ORA book had small snippets of code based solutions (very similar to the PHP Developers cookbook from Sterling and Andrei) that are very useful for programmers who are confounded with small to medium coding problems. However, there was nothing enterprising about the coverage, that one could not achieve from using a combination of the online docs + mailing lists. Another downside was that i could not find full solutions that i could re-use in my projects.

On the Other hand, i found

o The WROX book offered complete solutions to real world problems - a Simple/advanced CMS (the core of which you can plug into your site), a simple search engine, a classified ads board, and lots of cool creative case study solutions that i could extend to use in my hobby sites. The content was very enterprising and all of the solutions presented are the most popular one's amongst web developers these days. More interesting is that these solutions can be completely re-used and extended into your projects. However, the downside of this book is that you would need to have prior PHP knowledge either picked up from WROX' Professional PHP 4 (as is mentioned as a pre-requisite in the book) or from the Programming PHP ORA, or any another competent professional PHP programming books in the market.

So the bottomline is:

oCare for an appetiser - Pick up the ORA book.
oCare for a full meal - Pick up the Wrox book.

I am posting this same review for both the books (so customers can benefit from it). However, i have ranked the Wrox book, a notch above this one, simply because i wanted a burp:-)

4 stars A very good "cookbook" reference

2003-10-15     21 of 21 found this review helpful

I have been programming PHP for a couple of years, and have lots of books on the subject. IMHO, I felt like this book serves the role of a "cookbook" very nicely. The contents are organized by language function via chapters (i.e. strings, numbers, arrays, regex, forms, classes, db, security, XML, etc...) which makes it convenient to find what you are looking for. Within each chapter, are very specific "Problem" and "Solutions" which contain simple code snippets (like 10 lines or less) and a description of what it does. Most problems are solved within one page. It is really concise and to the point. The index is comprehensive so it is straightforward to lookup the issue you are having, find the problem / solution and get on with your coding. You don't have to read thru lots of code or descriptions of why somebody setup a display template or complicated object. Look up your problem, read a quick solution, and BOOM, you're done and back to implementing it in your code.

I have read some other reviews for this book here that recommend the Wrox book, stating this one is too simple. I don't agree with this. The Wrox book appears to me to be another "... let's show you a bunch of full blown application examples ..." book to me, similar to the classic Welling and Thomson SAMS published text. The "cookbook" will not teach you the language, nor is that its intent; it assumes you know what you are doing.

This book is exactly what it says it is, a cookbook. If you need a quick solution to specific coding problems, at a fairly advanced level, it is a really good reference.

3 stars combo offer??

2003-01-15     17 of 25 found this review helpful

This book is a collection of smallish code snippets that don't go into depth, but may be useful for your programming needs if you have very basic PHP knowledge.
If you want a truly indepth cookbook with
full blown practical solutions that you
can reuse in your own applications, then
you must own a copy of the "PHP web development
solutions" book from Wrox.
I won both these books, and i have benefitted from reading the two...

2 stars Vague, incomplete

2005-07-03     15 of 23 found this review helpful

[I've removed the first few paragraphs of my original review because a commentor pointed out that they're inaccurate.]

[Book contains] vague language. Here's an example from page 150:

"Besides using -> to access a method or member variable, you can also use ::. This syntax can access static methods in a class. These methods are identical for every instance of an [sic] class, because they can't rely on instance-specific data."

OK, so what does this mean? Is Sklar saying that you use "::" when and only when you want to access static methods? Can you also use it to access non-static methods? How do you know when a method is static or non-static? Is the syntax for defining a static method different as in Java, or does it just depend on how you access it?

I suspect that unclear thinking, lack of talent for explaining things, poor editing, and haste all contribute to this lousy quality.

Another problem, also typical of O'Reilly books, is that there is a fair amount of "hand waving" as in, "here's a light introduction that really gets you nowhere. For further information...uh...see the docs." If I'm paying a lot of money for a tech book, I expect the author to attempt a thorough treatment of the topic, and not just blow it off in the middle.

There are also plenty of typos such as the one in the quoted passage above. Does O'Reilly even bother editing the books they publish?

5 stars A valuable asset for any developer

2003-05-03     14 of 15 found this review helpful

An excellent cookbook, following the old O'Reilly's tradition in the field. The recipes are clean, concise and elegant; the authors try to solve real world, common problems. Unlike other outdated books, the code is designed with PHP 4.2 or above in mind. A valuable asset for any developer, it assumes a decent understanding of PHP

5 stars A reference every PHP programmer should have

2007-01-03     13 of 13 found this review helpful

This is my first O'Reilly book in the "Cookbook" series. At first I thought this book would probably contain the code and instructions for building a couple of web applications such as a shopping cart or a blog engine. This isn't that book. Rather it provides the reader with code snippets that can be used as building blocks for all kinds of applications. If I had to describe this book in one sentence I would say it is as if the author took down all the "Hmm..., I wonder how that is done?" questions and created an answer key.

One thing I like about this book is that the authors don't waste the first few chapters trying to teach or give an overview of the language. Instead they hop right into the usage of the language that relates to real world stuff.

So here is a brief overview. The book covers PHP 5 and goes over many of the new and improved features. The first six chapters provide recipes for more basic subjects (strings, numbers, dates & times, arrays, variables, and functions. Again, this isn't an intro to PHP, that is another book such as Programming PHP from O'Reilly. This is that book you reach for once you have moved from PHP basics and are ready to build some real world stuff.

By chapter seven the authors are discussing classes and objects. I like using classes when coding in C++, so this is a good chapter for those who like OOP. The next nine chapters go over web stuff starting out with basic things like cookies, forms, and databases. Then the authors go into more advanced areas like session management, XML, automation and web services (REST, SOAP, Mail, FTP, LDAP, and DNS to name a few).

The next chapter [17] is on the topic of graphics. This is a cool chapter if you like to create dynamic images. Things like creating a button image on the fly, or generating charts. Graphics are great to have a knowledge of because everyone likes graphical presentation of data and this chapter can help you get there.

Chapter 18 is on security and encryption which I found rather helpful. No one wants there web application to be the link that allows data to be compromised, and this chapter deals with many of those problem areas. Chapter 19 covers localization, chapter 20 is on debugging and testing. The debugging section does a great job of getting a person setup with the tools they need to properly debug an application including creating your own exception class. This is an outstanding chapter that every programmer can appreciate since every application needs debugging.

The remaining chapters cover performance tuning, regular expressions, files, directories, command line PHP, PERL and PECL. Being a Perl guy I found it interesting to see how the authors utilized regular expressions in PHP. And the chapter on command-line PHP was outstanding; I thought the recipe for creating a PHP command shell was pretty cool.

CONCLUSION
--
This book is like having the answer key to most of the random questions a person comes up with when writing code. I found this book to be very useful, it will be one of those references that I keep close, and gets very little shelf time. It is a solid book. It is hard to say what parts I liked best because this is one of those books that you like and must have, but then as time goes on and you use it more and more its value grows. This is an excellent book and I would strongly recommend it the PHP users that want to move to the next level.

4 stars Highly recommened for web developers with basic/intermediate

2003-12-03     12 of 12 found this review helpful

If you are completely new to PHP, just forget about this book!
If you are looking for complete programming solutions, do so as well!
However, if you have some basic experience with PHP and MySQL this book is just great.
This book deserves the word "cookbook" as it contains over 600 pages of receipts (do not expect big explanations, but just snippets of code), which will help you to solve many problems. And the best of this book - in my personal opinion - is, that by reading it, you will find a lot of problems/solutions/ideas you have not thought about before.
Be warned: This book is not a real "help" for anybody who looks for the easy solution, but it will definitely help YOU to develop your site and develop yourself.
Just buy it - it's well worth the money and if this book won't pay out, none will!

5 stars Filled with GREAT examples

2003-06-25     8 of 9 found this review helpful

This book has been a lifesaver for me. As is the case with all those in the Cookbook series, this book is filled with practical examples. This isn't a tutorial book, but honestly, this book combined with the online docs were all I needed to build my own web site based around PHP. I definitely encourage you to buy this book if you're hoping to learn PHP!

5 stars Real Coders, Real Code

2003-01-07     8 of 11 found this review helpful

Sklar and Trachtenberg bring a great depth of programming experience to this incredibly useful cookbook. The clever code concoctions presented here have been refined by them in massive, real-world applications serving millions of users. If you have used some of the best sites ever delivered on the net, you have probably already used thier code. If you want to know how it is really done, buy this book!

5 stars Sklar and Trachtenberg's Expertise Shines Through

2002-12-11     8 of 9 found this review helpful

There's really no other way to describe "The PHP Cookbook" than to point out that Trachtenberg and Sklar are obvious experts in their fields. Easy to read, concise and simple to understand, this coding cookbook provides a soup-to-nuts approach to PHP. With just an average understanding of computer code and the will to learn an exciting new approach, "The PHP Cookbook" is a choice guide for those interested.

5 stars I am so lucky to have found this book

2004-12-03     7 of 7 found this review helpful

I have never written a review before, but I felt that I needed to put my 5-star vote in as my small token of thanks to the authors. So here it goes:

I have dabbled in PHP for a few months now, but am developing a php/mysql app for the first time. I refer to this book every single day. It's my favorite Oracle. I ask, it answers:

"How do I $MyDailyQuestion?"
"See page $MyDailyAnswer."

Sure puts a smile on my face!

This book does not make me read through pages and pages of code and explanation. Just enough code snippets and the most insightful reminders to help me solve my daily how-do-I's. It also tells you where to look up further info for each function/feature on-line.

I think you would love this book as much as I do if:
- you are somewhere between PHP super-newbie and super-master
- you have a pretty solid background in some other language
- you are using PHP now and have problems to solve everyday
- you learn well from small examples
- your vision starts to blur when presented with long chapters

My thanks to authors Sklar and Trachtenberg! Happy hunting.

3 stars Great book but desprately needs an update!

2005-08-23     6 of 6 found this review helpful

This is a good book for learning how to use the tools PHP provides. However, in 2005, the tools are out of date... For instance a lot of the XML parsing has been updated so the code in the book is largely deprecated.

4 stars ...but if you want PHP 5, this is the book!

2006-11-18     5 of 6 found this review helpful

There is no comparison between Wrox and O'Reilly books! O'Reilly wins hands-down!

This 2nd edition of the PHP Cookbook offers real, useful, insightful information. The content is not "just recipes," but a consise approach to everyday problem solving using PHP. The organization of the book exposes this problem solving as a series of recipes that answer particular problem-domain questions. The diversity of the problem-domains accounted for in this text are amazing! If it is web or Internet related, this book probably has an answer for your most demanding PHP needs.

In the fine tradition of O'Reilly books, this text is very well presented, exceptionally well edited and organized in a manner that makes sense to the reader. It is not filled with fluff or hyperbole designed to add page count the way the thick volumes at Wrox seem to do. If you need every little thought spelled out for you, maybe you should buy a "PHP for Dummies" book. Otherwise, you can't go wrong with this excellent, well presented book that truly is "Solutions and Examples for PHP Programmers."

4 stars Good reference

2006-09-01     5 of 5 found this review helpful

(My review refers to the 2003 edition).

This book has loads of information about stuff you do on a normal basis with PHP, including XML parsing, form processing, string and array manipulation, etc. I think the book is well written and indexed with good examples, but I think you won't get much more information than the PHP user manual.

In my opinion PHP has better free user documentation than all the other languages I use on a regular basis (Java, Ruby and PERL). You can download their user manual and PEAR manual in a whole bunch of formats, including CHM, which gives you the ability to browse it like any other Windows help file (which gives you the ability to search). Most of the points in this book are covered in the same depth in the PHP user manual and you don't have to pay for it.

5 stars Great Reference Book with excellent examples!

2005-12-12     5 of 5 found this review helpful

You need a solution to a problem? This book will give you the answer. This is a great reference book that helped me a lot and I think that every PHP programmer should own. This book is the next best thing to searching Google for PHP answers where you can find a wealth of information. The examples are very useful and the flow of the book is perfect. When I bought this book it was expensive but it was worth every single penny.

You need to know the basics of PHP coding before this book is useful. But if you know at least the basics you are going to find this book to be your best PHP teacher.

4 stars PEAR DB

2006-12-07     4 of 4 found this review helpful

This is basically an excellent book. A lot of very useful stuff. Unlike the online PHP manual, it is on this technology called a book. This comes in handy on say a NYC subway train, where you want to brush up on some PHP, or find the solution for something you are working on.

One major warning though: all the database stuff (about 20-30 percent of the book) depends on the PEAR DB class. That is a great thing to use as are many of the PEAR classes. But there is certainly great PHP code that doesn't rely on PEAR DB.

Besides the db stuff the book has great examples with strings, numbers, I/O (files and directories), dates, etc. And being that I used to be a Reptile Biologist - you got to love that Iguana. If nothing else, just buy it for the cover.

5 stars Best Book on the Market

2003-01-11     4 of 8 found this review helpful

Comprehensive and well-written. Has great depth and creative case study solutions. Sklar and Trachtenberg 's PHP Cookbook has more to offer than any other book on the market.

5 stars great php book

2004-09-30     3 of 3 found this review helpful

Full of usable real world examples. Combine this book with some of the great php community web forums and the php.net manual and you are all set.
While I did find some errors in the book, a quick email to the publisher tended to get a quick response and one good thing about O'Reilly is they maintain a list of confirmed errors on the book webpage along with downloads of all examples.
In general its a great book for someone who knows programming and wants to pick up php, but probably not for the beginner who knows nothing.
The book's weakest point is probably dealing with objects and classes.

5 stars This book offers real solutions for real issues.

2004-06-19     3 of 3 found this review helpful

Most books cover commands and functions as though they were disembodied topics and don't relate them to the real world.

PHP Cookbook must be written by a "real developer" because he addresses actual everyday issues and illustrates practical solutions that you can use in your own applications.

I highly recommend this book.

- Hank Castello
compusolver.com

3 stars WITH SOME DRAWBACKS, BUT STILL A GOOD BOOK

2003-01-30     3 of 5 found this review helpful

The main preoccupation of this book is finding solutions to common PHP programming problems. It contains a series of instructions on how best, programmers and/or web designers, who monitor dynamic web contents could apply scripting language. This book would arouse the interest of anyone who already knows the fundamentals of PHP.
Its main drawback is that it is overtly abridged. Fledging PHP followers may criticize it for lacking the type of depth and practical application that non-advanced learners would want. Still, it is not a bad book to spend your wad on.

5 stars Brilliant

2003-01-01     3 of 7 found this review helpful

Like having the professor at my side. Articulate. Full of good ideas and helpful explanations. Must have for programmers!

5 stars Any professional PHP user needs this.

2006-11-07     2 of 2 found this review helpful

Web developers might already know PHP, but this updated second edition of a classic still remains an important desk reference to solving common problems and coding obstacles. PHP is used on millions of web sites today, so its depth and applications hold many possibilities for confusion as well as opportunities for optimization choices. PHP COOKBOOK covers all angles, from processing XML and obtaining solutions to common applications problems to working with JavaScript interactions. Any professional PHP user needs this.

Diane C. Donovan
California Bookwatch

5 stars Allow Unix scripters to learn PHP in record time.

2005-02-05     2 of 2 found this review helpful

This book, utilizing O'Reilly's cookbook format, starts each chapter with common tasks and describes nearly every aspect of PHP required to perform the task. I have previous Unix scripting experience and I was quickly able to develop quality PHP applications in a very short amount of time. The cookbook format allows me to easily return to important sections for refresher information.... thus making this a great learning tool and an excellent reference.

4 stars Good for intermediate developer

2008-04-13     1 of 1 found this review helpful

This book is not for someone who doesn't know programming. If you haven't coded at all in your life and don't basic PHP syntax you need a different book.

It also isn't a full solution for your site. You can't by this book and expect it to provide a complete solution for your programming needs.

What is it. It is a collection of discrete coding examples of how to program. It's not a book of syntax. It is a book of techniques that you can learn and then use as needed on your own projects.

I haven't read this book from end to end but when I recently had my first XML project it was useful to learn my different options on how to approach the project. Next I will be working on improving security. Again it has good examples that I can use and MODIFY for my own needs.

5 stars Yes, it's a GOOD buy

2007-12-11     1 of 2 found this review helpful

This review is for the 2nd edition and I got a copy from Amazon for a really good price. The time it already saved me from having to 'think' was more than worth the price. I did download the source from O'Reilly. It a very good source of usable working code that you can just 'cut and paste', and you might find yourself learning something here.That is what it was intended to be.

4 stars Solid and a good resource for PHP coders

2005-12-06     1 of 1 found this review helpful

I read reviews here on Amazon, and I usually see the "perfect for on your desk reference"... well, I have a shelf near my desk and this book doesn't spend much time collecting dust. There are some really good examples and code, some which may seem overkill (depending on your app and goal).

This is the book I open to see if there's an example or just to purge ideas/code from.

5 stars Good information

2005-09-21     1 of 2 found this review helpful

Well written and easy to understand as is typical of the Sklar books

5 stars Truly helpful!

2002-12-31     1 of 4 found this review helpful

Great book! Full of helpful info and easy to understand. Wonderful asset to have.

5 stars Terrific reference!

2008-11-25     0 of 0 found this review helpful

I'll keep this short - I love this book. It's come in handy more times than I can count. It contains great solutions to plenty of real world problems. I keep my copy at work, but plan on buying another copy to keep at home. I highly recommend this book.

5 stars Great semi-advanced updated book.

2008-07-17     0 of 0 found this review helpful

It is pretty good. Especially for the people who worked a little bit on php but not an expert yet. (That is me.)

5 stars Good book for programmers

2008-05-06     0 of 0 found this review helpful

This book is a good reference for people who already have a fair amount of programming knowledge. You don't need to necessarily know PHP since it's pretty similar to all the other languages out there. You should however have an idea of how a data driven website works.

5 stars There's a reason its O'Rielly

2008-05-03     0 of 1 found this review helpful

O'Rielly is a name I trust, and often look to for technical manuals. Their cookbooks and pocket guides are particularly sweet.


I am constantly pulling this book for snippets of code. Converting dates all around, array manipulation all the mundane but oh-so-common choirs.

I have already added an extensive collections of methods and classes based on the book's code. With my newly found admiration of Object-Oriented design and development I am able to reuse the code I create once again and again.

If you are new to Object Oriented coding, check out
Object-Oriented PHP: Concepts, Techniques, and Code

Together you can build powerful classes of date or array methods to handle anything you'll come across, and anything new only makes them better!

5 stars Great way to improve your PHP!

2008-04-24     0 of 0 found this review helpful

Each recipe states a Problem, gives a Solution, adds Discussion to help you understand the "why" behind the "what", and tosses in a "See Also" section if you need more info. There are 26 chapters of problem-solving recipes that will not only get you over the current hurdle but provide for learning in quick bits. Take a couple minutes, try something that interests you, and add it to your toolbox.

Awesome book!

5 stars Just what I wanted

2008-03-02     0 of 0 found this review helpful

I'm coming to PHP with a strong background in Perl and this book is perfect for me. In my mind, I know what I'd do in Perl to handle a given situation. With PHP Cookbook, all I need do is turn to the table of contents, find the section I need, and there's the solution. The code is well written and the descriptions very useful.

4 stars Must have for all PHP developers.

2007-05-15     0 of 0 found this review helpful

I find most technical books impossible to read from front to back. I typically just use them as reference books. Unfortuanately most techbooks aren't organized with this in mind. That's why I love the cookbook series. They tend to contain far more example code then typical programming books and are ideal reference books. The PHP Cookbook is an excellent resouce for PHP novices and experts alike. PHP Cookbook (2nd Edition) is exactly what you would expect from a O'Reilly's cookbook. Everyone reguardless of skill level will feel they hit the jackpot with this book because it has tons of sample code and examples that explain how to do just about anything imaginable in PHP.

The chapters are organized according to topic and each subsection is basicly a short how-to comprised of a problem, solution and disscussion section that explains the solution in detail. Topics include XML, form handling, database interaction, session management and a lot more. I find all O'Reilly's cookbooks to be extremely useful and PHP Cookbook is ceartainly the most useful PHP book I own.

3 stars Cookbook's galore

2002-12-21     0 of 0 found this review helpful

Among the PHP cookbooks in the market today, this one's good but lacks sufficient depth in coverage. It unfortunately has nothing more to offer than the PHP developers cookbook (II Edition). Infact,i found the latter to be more comprehensive and well-written. Another book, that is not actually labelled a cookbook, but is chockfull of completely re-usable solutions for web developers is the PHP4 Web Development Solutions book.

Buy it from AmazonNew for $29.69