Author: Kevin Tatroe, Peter MacIntyre & Rasmus Lerdorf
Audience: Programmers from other languages
Reviewer: Mike James
PHP isn't always taken as a "serious" programming language. However, given that it powers so many websites it deserves respect and attention.
This book takes about the driest and almost academic approach to the core PHP language I've encountered. It isn't quite as blunt as the classic K&R approach to C but it isn't far from it.
It starts with a basic introduction to PHP and if you need to read this first chapter then the book probably isn't for you but it provides a gentle lead in to the real start of the book which is Chapter 2.
At this point we start working through the syntax and semantics of PHP. First we do the basic lexical structure, data types, variables and so on through to flow of control. Chapter 3 continues in the same way covering functions including more advanced things like type hinting and anonymous functions. Chapter 4 moves on to strings, Chapter 5 covers arrays and finally we get to objects in Chapter 6. For me the whole idea of objects deserves more coverage early in the book but the approach is to explain the exact form of the language rather than convey any overall philosophy of programming.
The nature of the book changes at Chapter 7 on page 173. This covers the first of a number of practical topics and the emphasis moves away from the details of the language and on to ways of using it. Chapter 7 works its way though some basic HTML tasks - processing forms, using cookies sessions and SSL.
Next we look at databases in Chapter 8 and work with data objects, SQLite, and MongoDB. Chapter 9 deals with graphics in PHP - yes PHP can do graphics but you need the GD extension. PDF creation and manipulation is the subject of Chapter 10 using the FPDF library. Chapter 11 deals with processing XML, but there's no word on processing JSON which is becoming as, if not more, important.
Chapter 12 does a good job of discussing security in a general sort of way. The remainder of the book is a bit of a collection of things that didn't fit elsewhere. Chapter 14 is about PHP on different platforms including interfacing with COM. Then we have a chapter on web services - REST and XML-RPC and one on debugging. Finally the book finishes with a very short chapter on dates and times.
Well it almost finishes at this point but there is a an appendix of function references which runs to over 100 pages. This is a waste of paper, given how good the PHP documentation is for individual functions. The space might have been better used for a longer look at dates and times and perhaps a look at the methodology of building object-oriented PHP sites.
What is missing from this book is any design philosophy. There is no coverage of MVC or any sort of design patterns, just direct "how to code it" coverage of specific tasks. The first part of the book is very different from the content that starts at Chapter 7. If you are looking for a concise but descriptive coverage of the basic PHP language you might well like the first half of the book.
This is by no means a book for beginners. It would best suit a programmer coming from another language wanting a summary of the PHP language and then a set of discussions of how it is used. There are some very good parts of this book, but which ones they are will depend on what you want. I liked the terse introduction to the language, but didn't find the practical sections as useful.
A handy book to have on your bookshelf but it would be better without the 100 pages of information you can look up on the web more easily.