Having passed the 5.1 million Web site mark in December, it’s pretty clear that PHP is catching on in a big way. If you’re a Web developer who is still unfamiliar with PHP, it’s time to learn, and Beginning PHP4 is a good place to start.
The authors of this book do not assume that the reader is a master programmer who just happens to be getting started with PHP. They cover the fundamentals of programming — basic concepts like variables, loops, and arrays — in a way that most beginners will find easy to understand The authors, however, do expect the reader to know a bit about HTML, but just about anyone interested in PHP will probably have a basic grasp of HTML anyway.
Learning to Program
The authors of this book are very thorough, taking the reader through installation of PHP4 on various Windows platforms, Linux, and other Unices. From there, the authors dive right into demonstrating how to write simple programs with PHP and then progress into some more complicated concepts, such as accessing MySQL databases from PHP code and using PHP to create graphics.
In the “Generating Graphics” chapter, the authors do a particularly good job of breaking down a very complex subject and making it easy to follow. Whether the beginner to PHP is ready to tackle manufacturing graphics on the fly is another question, but they can always skip this chapter. It would have been beneficial to have a chapter on working with databases other than MySQL. PHP works with PostgreSQL, Oracle, mSQL, and several other databases.
Overall, the book is well written and easy to follow. The book’s organization is a little confusing, though. Simple concepts like handling e-mail are towards the back of the book after more complicated chapters such as ones on working with MySQL or error handling. The book contains two different chapters on working with clients (browsers), but they are six chapters apart. However, that’s really a minor issue since computer books are not usually read front-to-back. The PHP language reference is also helpful, though a bit terse. Since many of the functions are not demonstrated in the book, it would have been useful if the authors explained their usage more completely.
Difficult Concepts Made Easy
Beginning PHP4 really shines when it comes to pulling concepts together. It does so particularly well in the “Case Study” chapter. For example, chapter 17 walks the reader through PHP to create a Yahoo!-like directory that can be dynamically updated and edited. This is a great example tying together earlier material on using PHP functions and working with a MySQL database. It would have been nice to see at least one more case study chapter like this one. We would have particularly liked to see an example that illustrates how to work with the session tracking functions of PHP. In fairness, however, that may be beyond the scope of a beginner’s book.
In short, we recommend this book to anyone who wants to get started with PHP4. It’s not going to be the only book you’ll ever need, but it’s a very good starting place. While readers who are already familiar with PHP might want to look for a more advanced book, odds are they’ll still find some helpful information in Beginning PHP4.