PHP Cookbook: Solutions and Examples for PHP Programmers

Category: Book

Used starting at $15.97

New starting at $20.00

Buy it

Product Description

When it comes to creating dynamic web sites, the open source PHP language is red-hot property: used on more than 20 million web sites today, PHP is now more popular than Microsoft's ASP.NET technology. With our Cookbook's unique format, you can learn how to build dynamic web applications that work on any web browser. This revised new edition makes it easy to find specific solutions for programming challenges.

PHP Cookbook has a wealth of solutions for problems that you'll face regularly. With topics that range from beginner questions to advanced web programming techniques, this guide contains practical examples -- or "recipes" -- for anyone who uses this scripting language to generate dynamic web content. Updated for PHP 5, this book provides solutions that explain how to use the new language features in detail, including the vastly improved object-oriented capabilities and the new PDO data access extension. New sections on classes and objects are included, along with new material on processing XML, building web services with PHP, and working with SOAP/REST architectures. With each recipe, the authors include a discussion that explains the logic and concepts underlying the solution.


Product Details

Publisher O'Reilly Media
ISBN 0596101015
Features
  • ISBN13: 9780596101015
  • Condition: New
  • Notes: BUY WITH CONFIDENCE, Over one million books sold! 98% Positive feedback. Compare our books, prices and service to the competition. 100% Satisfaction Guaranteed
Format Paperback
Author Adam Trachtenberg,David Sklar
EAN 9780596101015
Label O'Reilly Media
Edition 2
Dewey Decimal Number 005.2762
Studio O'Reilly Media
Number Of Pages 816
Title PHP Cookbook: Solutions and Examples for PHP Programmers
Publication Date 2006-08-01
Manufacturer O'Reilly Media

Customer Reviews

A helpful book

Review by Travis, 2010-05-05

This review is for the second edition.

In all, this is a good book. The book is organized by "problems". For example, one problem is "You want to return more than one value from a function." The book provides a solution, followed by a lengthier discussion of why this is a good solution, and in what circumstances it might not be.

The problems run from relatively simple to somewhat complex and cover a wide variety of things. I think it would be rare to have a problem that couldn't be found in here, so it's definitely a helpful reference.

One flaw with the book is that a number of the problems are probably best solved by making use of a PHP framework (e.g. Zend Framework). For example, it's probably better to use a framework that provides various form validation functions, rather than rewriting and coding all the different validations you need from this book. But, maybe in some cases it will help you get by if the particular thing you want to do isn't covered by your current framework.

The book isn't perfect, but ultimately deserves a place on your bookshelf if, like most of us, you often find yourself wondering "What's the best way to do this?"


Hit AND Miss

Review by Darkness' Ally, 2010-03-26


I've owned this book for about 2 years, my PhP coding experience being intermediate both before AND after reading it. It is by no means a lesson book, as implied by another person's review, but instead follows the term "cookbook" very well. A quick explanation of my review's title: "Hit AND Miss". It's mostly "hit" but there are a few aspects that left me feeling as though I was lacking in level of knowledge, something also expressed in another person's review, concerning the book's contents.

For one, for up to intermediate small issues it definitely hits the mark. The code snippets are (mostly) well-commented or explained in the surrounding paragraphs, as well as (from what I can tell) easy on server load. Some are (of course) more processor-intense than others, but that's the nature of any programming/scripting language: some stuff's simple and quick and other stuff is just downright tedious to type-out and (possibly) can become a thorn in the Server's side (forgive my pun).

The book's Problem-into-Solution format is very easy to follow, almost identical to a Q&A format. The table of contents in the book alone is far more extensive than I would ever expect from a book of this size, and it is definitely a wealth of knowledge, technique and guidelines up to a certain point.

If I had to pick one thing to complain about it would have to be some of the solutions themselves. My other complaints are nothing compared to this one. The following is based on my own personal preference and server settings/extensions, so if you have PEAR and like using it (most people do, it seems), then disregard the following.

A bunch of solutions are explained using PEAR. It's been so long since I've read up on PEAR that I've no clue of what it stands for or even if you have to install it a certain way. Be that as it may, I choose not to use frameworks of any kind most of the time. PEAR is at the top of my "do not use" list. I've seen what it can do, and I think it's great, but I want to get my hands dirty, and PEAR can really take that away. Back to it: the PEAR-based solutions more often than not come with no alternative solution. There is one I remember concerning pagination where it gives the pure-PEAR way and an alternative. However the alternative involves other PEAR extensions. The alternative is an alternative to only PEAR's "DB_Pager" class, and not a full alternative. One would need to know what the PEAR was doing (have PEAR) and alter the code to keep it PEAR-free if one were in my shoes. I've since been able to adapt it, it wasn't hard. But there are beginners out there who have poor skills at transposing (correct word?) code from classes or frameworks into something completely customized. When I started out it was the OREILLY PHP Cookbook and the OREILLY Learning PHP & MySQL books I started with, along with some guitar books for learning Christmas songs (I know, unrelated, same box though :P).

All-in-all the book is worth the price. The pros outweigh the cons almost 3 to 1. I still use this book to refresh my memory of techniques long since forgotten or fuzzy, even 2 years after I've purchased more advanced books that cover most of the same things in greater detail and moulded for greater scale. PHP as many know is very unforgiving when it comes to screw-ups, and the little things that you forget can make or break a script. I'll be keeping this book for years and years to come to dust off and refresh my memory. My website is still lacking, but heck, it's a personal website, and wouldn't be nearly as good (??? :P) as it is now without the "cookbook".


Boils down what you want your scripts to do

Review by J. Page, 2010-01-23

A book to teach simplification in coding. For everyone who has read three or four PHP books, this book solves so many puzzles you may have created for yourself. Each recipe gives you a good basis for using a PHP function. As the recipe progresses, the book sometimes demonstrates how to simplify your code further. By the end of each recipe - usually no longer than a page or two - it introduces discussion as to the usefulness of the script or resources to read more about expanding upon the function.


Finally a book that covers more than just the basics

Review by Big Al, 2010-01-15

I've looked through a lot of PHP books and it is very difficult to find good ones (that is for more than the basics). This book fills in a lot of the gaps in understanding how PHP works, with explanations of more advanced techniques, like regular expressions and cURL.

Recommended.


Use it every day I program with PHP

Review by psulover901, 2009-09-28

This is an indispensable tool for PHP programmers! There are so many great, no BS examples in here. There are about 24 chapters, each with about 10 to 15 examples. I found the Files and Directories sections to be very chock full of information. The Array and Form sections are great too.

This book is not for beginners, because as I said, most of the fluff has been cut out and each recipe is only 1 - 3 pages long. However, if you have a strong background in other languages, then once you learn PHP's syntax (which is similar to C), this book is a great reference for when you need to look up how to do something specific. It's a lot easier than looking it up on PHP's online manual (which I have to say is excellent; thanks PHP!)

There are also a few mini programs that are excellent, like a "Tiny Wiki".

My only quam (spelling?) with this book is that the Database section doesn't cover the mysql and mysqli extensions. But, these functions are simple enough that you can just look them up anywhere.

If you do any PHP programming, then you need this book!

Fantastic job David and Adam!


Similar Items
Programming PHP

Programming PHP

Used starting at $6.47

New starting at $22.38

Buy It More Info
MySQL Cookbook

MySQL Cookbook

Used starting at $24.96

New starting at $27.48

Buy It More Info
PHP and MySQL Web Development (4th Edition)

PHP and MySQL Web Development (4th Edition)

Used starting at $28.95

New starting at $29.99

Buy It More Info