| A |
![]() |
Book |
Introduction: The book makes the assumption that the reader is familiar with variables, loops, and other basic programming concepts and has some experience using PHP or a similar programming language. Its introductory style, however, pretty much explains everything from the ground up. For example the book devotes two paragraphs to explaining the advantage of using functions and a full paragraph explaining why an endless loop is sometimes desirable (while accepting user input). It seems that a person with no knowledge of programming can learn it here.
Its 22 chapters touch briefly on just about every aspect of the language; from basic variables, arrays, and control structures to the Object-Oriented, Database and Graphics features. This was no easy task, considering that PHP has grown immensely during its short life. The section on regular expressions is a very good introduction to a complex topic, even though there is no summary table of meta-characters, as one might expect in a "nutshell" book. It has a nice introduction to Object-Oriented PHP explaining the basic concepts of class, methods, and properties using an example of a "Dog" class with a "Bark" method (Woof), which can be extended to a "Poodle" class with a redefining "Bark" method (Yip), and finally creating "Poppy", an instance of the class "Poodle".
Comments: My main gripe with this book is that it is billed as being helpful for the experienced PHP programmer. The back cover states "Whether you're just getting started or have years of experience in PHP development PHP in a Nutshell is a valuable addition to your desk library." If you are familiar with the classic "Linux in A Nutshell" book, you'll be sorely disappointed if you expect anything like that with this book. A better title might be "Learning PHP".
A desktop reference it isn't. Written in the chatty style reminiscent of a "Dummy's" book it notes, for example, that strstr() is a "nice and easy function". Here is the prose for abs(): "The abs() function returns the absolute value of the parameter you pass to it. By absolute, I mean that it leaves positive values untouched and converts negative values into positive values..." This is fine style if your intended audience is the proverbial "less-than-gifted first-year high-school student", but not for anything billed as a desktop reference.
These are not just occasional diversions from the terse and succinct style of a "Desktop Reference" type book. Many function descriptions help expand the bulk of this book by noting, immediately after the function header, how many parameters the function requires. i.e.
hexdec() number hexdec ( string hex_string ) The hexdec() function converts a hexadecimal number into a decimal number. It takes just one parameter, which is the number to convert...
Conclusion: This book doesn't pretend to replace the excellent on-line documentation and believe me, it doesn't. As an example, PHP has 174 categories of built-in functions; one category alone, "strings", contains 106 different functions. The book's function reference lists only 86 functions total. By comparison, O'Reilly's excellent book "Programming PHP" lists 420. Considering that the "Programming PHP" book is only $10.00 more, if you are serious about programming PHP, buy it, and leave PHP In A Nutshell at the bookstore. On the other hand, if you're curious about PHP, give it a try. I think you'll like it and you will certainly learn a lot.