PHP Cookbook 238
PHP Cookbook | |
author | David Sklar and Adam Trachtenberg |
pages | 608 |
publisher | O'Reilly |
rating | 9 |
reviewer | Edmond Lau |
ISBN | 1565926811 |
summary | Solutions and examples for PHP programmers. |
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.
YES!!! (Score:5, Funny)
In all seriousness I enjoy PHP because it is pretty self explanatory, and it can use plain old html inside it too. It's just nice to use a scripting language for the web that was made for webpages originally, not a language that was created for ...
Student Suspended Over Suspected Use of PHP (Score:3, Funny)
"A teacher overheard him say that he was using PHP, and as part of our Zero-Tolerance policy against drug use, he was immediately suspended. No questions asked," said Principal Clyde Thurlow. "We're not quite sure what PHP is, but we suspect it may be a derivative of PCP, or maybe a new designer drug like GHB."
Parents are frightened by the discovery of this new menace in their children's school, and are demanding the school do something. "We heard that he found out about PHP at school on the internet. There may even be a PHP web ring operating on school grounds," said irate parent Carol Blessing. "School is supposed to be teaching our kids how to read and write. Not about dangerous drugs like PHP."
In response to parental demands the school has reconfigured its internet WatchDog software to block access to all internet sites mentioning PHP. Officials say this should prevent any other students from falling prey like Brett Tyson did. They have also stepped up locker searches and brought in drug sniffing dogs.
Interviews with students suggested that PHP use is wide spread around the school, but is particularly concentrated in the geeky nerd population. When contacted by BBspot.com, Brett Tyson said, "I don't know what the hell is going on dude, but this suspension gives me more time for fraggin'. Yee haw!"
PHP is a hypertext preprocessor, which sounds very dangerous. It is believed that many users started by using Perl and moved on to the more powerful PHP. For more information on how to recognize if your child may be using PHP please visit http://www.php.net.
Re:YES!!! (Score:3, Funny)
OR
Pathologically Electic Rubbish Lister
Re:Ain't php great? (Score:2, Funny)
rmstar
Re:More PHP (Score:3, Funny)
Having a pretty broad background in VisualBasic...
*puts on asbestos suit and goggles*
And, of course, making a typo in a variable name can make debugging a real headache. Because you don't have to cast your variables, anything you type is valid, and typos don't generate errors! (You'll always find "Option Explicit" in my VB modules!)
Having about a month's worth of self-taught PHP behind me, and actually being very comfortable and productive with it, I find that the no-cast variable system works very smoothly. It's a little wierd when it comes to arrays, but good naming conventions help there. It's nice to not have to stop and make a new variable declaration all the time - just code.
And let's not forget the true power of no-cast variables: obfuscation! He's using it as a flag! No wait.. it's a loop counter! NO! It's an array! AAAHH!!
=Smidge=
Re:YES!!! (Score:3, Funny)
No, it just needs a module_for_everything.pm
What? No OOP fight? (Score:2, Funny)
Re:The perfect companion for this book... (Score:3, Funny)
Re:More PHP (Score:3, Funny)
Types aren't hidden in PHP
As anyone can plainly see
They are not hidden from your code,
They're right there from the time you load.
With gettype() they're revealed to you,
With *val() you can set them too.
There's so much flexibility
I can hardly contain my glee.
Setting, seeing, casting types,
PHP answers all your gripes.