PHP Cookbook (2nd Edition)

PHP_Cookbook2I 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.



Save prescious web development time using PHP Cookbook, Second Edition. With solutions to real-world problems at your fingertips, information is instantly available for a multitude of coding challenges.

Used on more than 20 million web sites today, PHP is more popular than any other scripting language. PHP’s natural simplicity combined with our Cookbook’s unique format helps you build dynamic web aplicaions that will work on any web browser. This revised edition makes it easy to find specific solutions for programming challenges, including:

  • Form Handling
  • Database interaction
  • Session management
  • Using web services

With topics that range from beginner questions to advanced web programming techniques, this guide’s recipes contain practical examples for anyone using PHP to generate dynamic web content. Each recipe includes a discussion that explains the logic and concepts underlying the provided solutions, and insights from PHP veterans to help you master the language with ease. Updated to cover PHP 5, this book explains in detail how to use new language features, such as the vasly improved object-oriented capabilites and the new PDO data access extension. New sections on classes and objects are included, along with the following essential material:

  • Processing XML
  • Interacting with JavaScript
  • Building web services with PHP
  • Working with SOAP and REST architechtures

With over 250 recipes, PHP Cookbook, Second Edition, has a wealth of solutiosn ofr problems that you’ll face regularly. Furthermore, each recipe;s discussion section imparts valuable concepts that will be useful to any PHP developer.


Table of contents:

  • Copyright
  • Preface
  • Chapter 1. Strings
  • Chapter 2. Numbers
  • Chapter 3. Dates and Times
  • Chapter 4. Arrays
  • Chapter 5. Variables
  • Chapter 6. Functions
  • Chapter 7. Classes and Objects
  • Chapter 8. Web Basics
  • Chapter 9. Form
  • Chapter 10. Database Access
  • Chapter 11. Sessions and Data Persistence
  • Chapter 12. XML
  • Chapter 13. Web Automation
  • Chapter 14. Consuming Web Services
  • Chapter 15. Building Web Services
  • Chapter 16. Internet Services
  • Chapter 17. Graphics
  • Chapter 18. Security and Encryption
  • Chapter 19. Internationalization and Localization
  • Chapter 20. Error Handling, Debugging, and Testing
  • Chapter 21. Performance Tuning and Load Testing
  • Chapter 22. Regular Expressions
  • Chapter 23. Files
  • Chapter 24. Directories
  • Chapter 25. Command-Line PHP
  • Chapter 26. PEAR and PECL



Authors: Adam Trachtenberg, David Sklar