BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?

PHP Cookbook

By David Sklar, Adam Trachtenberg
First Edition  November 2002 
Pages: 632
Series: Cookbooks
ISBN 10: 1-56592-681-1 | ISBN 13: 9781565926813
starstarstarstarstar (Average of 11 Customer Reviews)

This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.

The latest edition is also available on Safari Books Online.

Book description

The PHP Cookbook is a collection of problems, solutions, and practical examples for PHP programmers. The book contains a unique and extensive collection of best practices for everyday PHP programming dilemmas. It contains over 250 recipes, ranging from simple tasks to entire programs that demonstrate complex tasks, such as printing HTML tables and generating bar charts -- a treasure trove of useful code for PHP programmers, from novices to advanced practitioners.
Full Description

PHP is a simple yet powerful open source scripting language that has become a big player in web development. Over a million web sites, from large corporate sites to small personal sites, are using PHP to serve dynamic web content. PHP's broad feature set, approachable syntax, and support for different operating systems and web servers make it an ideal language for rapid web development. The PHP Cookbook is a collection of problems, solutions, and practical examples for PHP programmers. The book contains a unique and extensive collection of best practices for everyday PHP programming dilemmas. For every problem addressed in the book, there's a worked-out solution or "recipe" -- short, focused pieces of code that you can insert directly into your applications. But this book offers more than cut-and-paste code. You also get explanations of how and why the code works, so you can learn to adapt the problem-solving techniques to similar situations. The recipes in the PHP Cookbook range from simple tasks, such as sending a database query and fetching URLs, to entire programs that demonstrate complex tasks, such as printing HTML tables and generating bar charts. This book contains over 250 recipes on the following topics:
  • Working with basic data types, including strings, numbers, dates and times, and arrays
  • PHP building blocks, such as variables, functions, classes, and objects
  • Web programming, including forms, database access, and XML
  • Useful features like regular expressions, encryption and security, graphics, internationalization and localization, and Internet services
  • Working with files and directories
  • Command-line PHP and PHP-GTK
  • PEAR, the PHP Extension and Application Repository
This book contains an impressive collection of useful code for PHP programmers, from novices to advanced practitioners. Instead of poking around mailing lists, online documentation, and other sources, you can rely on the PHP Cookbook to provide quick solutions to common problems, so you can spend your time on those out-of-the-ordinary problems specific to your application.

Browse within this book

Cover | Table of Contents | Colophon




Featured customer reviews

Write a Review


Wow!,  June 17 2004
Rating: StarStarStarStarStar
Submitted by Munchahat Development Team   [Respond | View]

The PHP Cookbook is one of the better books for PHP I've seen. It covers a wide range of topics and talks about things that most books don't. It was very up to date and extermley helpful. It really helped me solve my programming problems.


Excellent Primer,  May 23 2004
Rating: StarStarStarStarStar
Submitted by Mei   [Respond | View]

PHP Cookbook is extremely well organized, massively useful, and easy to read.

This should not be your first programming book (a caveat the authors have mentioned in their introduction) as it does assume some familiarity with programming concepts. It can, however, be your first PHP book as its thorough "See Also" sections provide ample reference to the PHP Docs and Manual.

I read this book from cover-to-cover without ever getting bored (but maybe I'm strange). Thankfully the internet was constantly available because if you're a noob like I was you'll probably find yourself looking up all the function references as you read through the book.


Great book,  May 18 2004
Rating: StarStarStarStarStar
Submitted by Anonymous Reader   [Respond | View]

I was extremely happy with this book. I am actually new to PHP, but with knowledge of html and asp, this is the perfect reference.

If you need to use PHP to do FTP, you may find that page 442 is missing. I called Customer Service and they sent me this link right away:

http://examples.oreilly.com/phpckbk/ch17_442.pdf

Read all reviews


PHP Cookbook Review,  January 12 2004
Rating: StarStarStarStarStar
Submitted by Mads B. Rasmussen   [Respond | View]

I can't but help giving this book the highest marks possible. I've read a quite a few books on the subject and this one is by far the most useful.

If provides examples and explainations for almost situation you could imagine.

I read it from front to back, and now I use it as a refference along with online manuals and the sorts. Great for "real life" web application development. Leave the hardcore theory for the PHD's :).


PHP Cookbook Review,  August 28 2003
Rating: StarStarStarStarStar
Submitted by Marie Mazerolle   [Respond | View]

This is the most useful book I've ever bought! I've read it from cover-to-cover, and I used a LOT of recipes. It was my first cookbook, but since then I've also bought the java cookbook. I just wish there were more books in that collection.


PHP Cookbook Review,  August 15 2003
Rating: StarStarStarStarStar
Submitted by Fred Darel   [Respond | View]

Easy to ready but poor examples. Should follow MySQL CookBook - this one an execellent one: good examples with explanation.


PHP Cookbook Review,  July 27 2003
Rating: StarStarStarStarStar
Submitted by Jono Bacon   [Respond | View]

I am a professional writer asnd web developer, and I find this book is one of the most fantastic books I have ever used. Virtually every PHP problem I encounter has been answered to some extent with the book. If the book does not give the complete solution, it puts you in the right direction.

There is a good amount of information in this book, and provides a easy access method for getting what you need. If you code with PHP, get this - you won't regret it.




PHP Cookbook Review,  June 09 2003
Rating: StarStarStarStarStar
Submitted by Anonymous   [Respond | View]

I'm a beginner in PHP. I read this book every day now and I find it very useful and well written. PHP Cookbook gives the reader a Q&A approach to PHP, which is practical and easy.


PHP Cookbook Review,  February 25 2003
Rating: StarStarStarStarStar
Submitted by Kenneth Wilcox   [Respond | View]

This book has a little bit of everything. It may not taste as good as something you can make with Betty Crocker, but the end result is the same. I've used several examples in my php pages already. (Who knew if (8 = = $myvar) would solve potential problems) I was disappointed with one example so far, it answered the question with a php class with no example of how to implement that class. Now with a little hacking you can figure it out, but I was hoping these recipes would have the solution all hacked out for you. Still an excellent book, and worth getting, but like all version 1 releases, it could use some more work.


PHP Cookbook Review,  December 30 2002
Rating: StarStarStarStarStar
Submitted by joseph   [Respond | View]

A very, very good book. I recommend this text with no hesitation.


PHP Cookbook Review,  November 06 2002
Rating: StarStarStarStarStar
Submitted by jonas Okwara   [Respond | View]

It is a great book


Media reviews "The 'PHP Cookbook' should be on every PHP programmer's bookshelf...The 'PHP Cookbook' managed to cover every topic I could have hoped for...I don't know how I ever got along without this book."
--Chrispian Burks, Sitepoint, June 2003
http://www.sitepoint.com/article/review-php-cookbook

"Altogether this book provides almost an ‘essential’ reference manual for people who program in PHP. Each solution provides at least a very good starting point for almost every individual problem you might encounter when using PHP for web sites and even gets you going with CLI programs, and in most cases you probably won’t need to look any further. It could save you many hours of sitting and wondering how to start when faced with the challenge of coding a specific solution, or searching the internet for ages."
--Mike Wright, Entwickler.com, May 2004
http://www.php-mag.net/itr/buchtipps/psecom,id,271,nodeid,115.html

"Bottom line, unless you are a beginner PHP developer get this book. If you are new to PHP, buy a beginning PHP book THEN buy this book."
--Jen deHaan, Calgary Flash User Group, February 2004
http://www.flash-mx.com/books/phpcookbook.cfm

Read all reviews

See larger cover