# Book Review: Learning PHP5

This book by David Sklar, is a great introduction for those with little or no experience doing web programming (or even programming at all :-). He takes the reader from the basic ideas behind programming for the web using PHP, to the basis of the language, to more complex topics dealing with generation and consumption of content in different formats (e.g. RSS feeds, PDF files, etc.).

There are several things I particularly like about this book, one is that it does not shy away from introducing beginners to concepts that initially could be difficult, but are useful and critical in the long run for good web programming. It deals, for example, with multidimensional arrays in a clearly written (albeit a tad short) section of the book, in a chapter explains in good detail the technology and mechanics of web sessions, it even has a chapter that whets the beginner’s appetite by giving a taste for what other things can be accomplished using PHP (CLI programming, classes and objects, advanced math, encryption).

The style of the example programs is also clear, organized, and pragmatic. David, as any seasoned code-mangler tends to be, is a lazy programmer (see: Laziness, Impatience, Hubris), which shows in his reuse of other people’s code to build programs in a more efficient manner. He makes use of (for example) PEAR::DB to make life easier for the developer, of the new SimpleXML extension in PHP 5 show how simple is to gobble up an XML file and mangle it in PHP.

The book gets bonus points for his good coverage on installing PHP on different platforms (in particular how to fix the fubared PHP installation that comes as default with Mac OS X “Panther”), and a nice appendix on the basics and use of regular expressions. It all makes for a well rounded introductory book, and a great complement to the on-line language reference (aka PHP manual).