PHP Cookbook
The approach that the authors use in PHP Cookbook is great. Like most computer books, the authors usually include a summary (in sentence forms) to illustrate what the readers will expect in each chapter. Skalar and Trachtenberg take this even further by including some preliminary (code) examples to explain the general ideas behind each chapters. The examples in the book are self-contained. In most cases, I've found examples to exactly fit my needs -- this makes it one of the better reference books.
Each chapter in the book is divided into multiple sections of Problem / Solution / Discussion with a FAQ style. In each case, a simple description of a problem is followed by a PHP script as the solution. But the meat is actually in the discussions: in-depth details are included here, where the authors also include references, extended ideas, and scripts to inform the readers how much more they can do about the issue.
For example, I was going to add a simple script to my website to parse RSS/RDF files from certain news websites (CNN, Slashdot, ...), and use it as my Mozilla homepage. (Who wouldn't?) This script seems to be simple, but I may make a mistake here and there. As reference, I opened up the book to the section "Parsing XML with SAX." Then I realized the authors already had the script to parse RSS/RDF files in the discussion. Bravo!
For myself, the most useful chapters I found are: Web Basics, Forms, Database Access, and XML. There are also good examples in topics such as security, internationalization, and file processing/management. However, this book does not cover the basics of PHP. If you are a good programmer, you should be able to get away with this using the PHP Manual. A good book to learn PHP is Programming PHP, also by O'Reilly.
Although this book covers a wide range of topics, it does not cover topics like generating PDFs. I would also like to see the authors add one (maybe two) case studies in later editions. That would give the reader a more concrete example of how to combine tricks presented by this book. Other than that, at the price of $39.95 (or $61.95 CAD), this book is a great buy!
Topics
- Strings
- Numbers
- Dates and Times
- Arrays
- Variables
- Functions
- Classes and Objects
- Web Basics - available online as example chapter
- Forms
- Database Access
- Web Automation
- XML
- Regular Expressions
- Encryption and Security
- Graphics
- Internationalization and Localization
- Internet Services
- Files
- Directories
- Client-Side PHP
- PEAR
You can purchase the PHP Cookbook from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Speaking as someone who has worked with both, php2asp is about as useful as those "pascal2c" tools that were so common a decade ago. It works in only the simplest of cases, and rarely supports the internal objects supported by most ASP languages (ie vbscript and jscript).
PHP blows chunks. It's too bad such a shitty little "language" has taken on such proportion simply because it was, for a while, the only "better" alternative on linux/apache to perl (an even shittier, even more cryptic little language).
Since the "language of browsers" is ECMAscript it makes sense to use that on the server, too, so one doesn't have to constantly shift back and forth between languages. And one doesn't HAVE to use an MS product in order to do so. It's really too bad so many otherwise intelligent folk abide the braindead notion that ECMA(java)script = ASP = MS.
The OO of PHP is excellent.
What does OO mean to you? I could be wrong, but I really think it means Object Oriented. I think there's a P missing in your sentences, standing for Programming.
The OOP features of PHP are excellent.
Destructors, private namespaces, multiple heritage: these are features PHP is currently lacking (I don't know if PHP 5 will offer such features). How is it better than other languages, OOP-wise (honest question)?