Oakland.pm

Reviews

Review of "Learning PHP 5"

author: David Sklar

reviewer: George Woolley


Learning PHP 5
By David Sklar
First Edition June 2004
ISBN: 0-596-00560-1
368 pages, $29.95 US, $43.95 CA, £20.95 UK

Short Review

Rating: Good. :) :) :) of 5

PHP is a server side scripting language that makes it much easier to build dynamic websites.

This book begins with a very good, easy to read introduction to the fundamentals of PHP. It then covers a number of more advanced topics where the going is rougher.

The book is a very good introduction to PHP. That's true even if what you have available to you is PHP 4. That's because most of what you'll learn in the book will work on PHP 4 or PHP 5 and because it's clearly indicated which features are PHP 5 specific.

While this book is a good introduction to PHP, it is not a good introduction to the new features in PHP 5.

If you want more, you could check out my somewhat longer review.

Miscellaneous

Chapter Titles

  • 1. Orientation and First Steps
  • 2. Working with Text and Numbers
  • 3. Making Decisions and Repeating Yourself
  • 4. Working with Arrays
  • 5. Functions
  • 6. Making Web Forms
  • 7. Storing Information with Databases
  • 8. Remembering Users with Cookies and Sessions
  • 9. Handling Dates and Times
  • 10. Working with Files
  • 11. Parsing and Generating XML
  • 12. Debugging
  • 13. What Else Can You Do with PHP?

Note:

Why PHP?

  • PHP Is Free (as in Money)
  • PHP Is Free (as in Speech
  • PHP Is Cross-Platform
  • PHP Is Widely Used
  • PHP Hides Its Complexity
  • PHP Is Built for Web Programming

Note:

  • The above are the titles of the subsections under the section "What's So Great About PHP" in the first chapter of the book.

Two Other Books on PHP

Note:

  • Both these books are very good, however neither covers PHP 5. In my case, that was not a problem.

Online Resources Watch

Safari logo image

This book is on Safari Tech Books Online. In fact, I read all the chapters of the book on Safari before I got the dead tree version.

See my review of "Programming PHP" for some more on online resources. (Look in the left column under Online Watch.)

Somewhat Longer Review

Contents

Note:

  • Published by O'Reilly.
  • To view the catalog entry for this book, click on it's cover image.

What's PHP?

PHP stands for "PHP: Hypertext Preprocessor". ;-)

PHP

  • is a programming language
  • is open source
  • is easy to learn
  • is easy to read
  • runs on the server side
  • can be embedded in web pages
  • makes creating maintainable web pages much easier

There have been several versions of PHP. The versions you definitely need to be aware of are PHP 4 and PHP 5.

PHP 4: PHP 4

  • was released in 2000.
  • is installed on many servers.

PHP 5: PHP 5

  • is the latest version of PHP.
  • was released in 2004.
  • has many improvements, most notably an improved object model and some new OO features.
  • has been available for some time

About the Reviewer

databases: I've done very little with databases.

O'Reilly: I own many O'Reilly books. I am generally quite satisfied with them. I'm a fan of O'Reilly.

Perl: I've been using Perl since 1994. My favorite language by far is Perl. Over the years, I've written a number of Perl CGIs.

PHP: I've only recently started to use PHP and have only used it a little. Try Random Geek Fun which I created using PHP. :)

I have read and reviewed two books on PHP 4.

My domain supports PHP 4 but not PHP 5. However, I have PHP 5 on one of my machines at home.

Webmaster: I've developed a number of websites and am currently the webmaster of several non-profit sites. However, I am definitely not a professional webmaster.

What I Expected

Title: Based on the title, I expected an introduction to PHP 5.

Cover: The cover, in addition to the title, includes the words "A Pain-Free Introduction to Building Interactive Websites". Based on those words I expected the introduction

  • to be unusually easy to follow
  • to prepare the reader to build dynamic websites.

Preface: Based on the preface, I expected that the prerequisites were just that the reader

  • should have basic computer literacy, i.e., be able to move files around, surf the web.
  • should know basic HTML tags such as <html>, <head>, <body>, <p>, <a>, and <br>.

What I Hoped: Personally, I hoped and expected that

  • I'd get an easy to read review of PHP language basics
  • I'd learn a little more about PHP 5
  • anything that wouldn't work in PHP 4 would be clearly marked
  • I'd feel comfortable recommending this book as an introduction to PHP

What I Got

An Introduction to PHP 5: This is certainly an introduction to PHP and to PHP 5 in particular.

I'd say that's already true after the first 5 chapters.

Preparation for Building Dynamic Websites:

By "dynamic" here I mean pages that are are returned differently from the server without anyone recoding them.

In this sense of dynamic, PHP is designed for building dynamic websites. Most everything in the book is relevant to that. This is particularly apparent in the following chapters

  • 6. Making Web Forms
  • 8. Remembering Users with Cookies and Sessions

Not Unusually Easy to Follow: However, I wouldn't say the book was unusually easy to follow after the first five chapters which cover the basics of the language.

Few Prerequisites: I think the stated prerequisites are correct.

My Hopes: All my hopes for the book were satisfied. (For what my hopes were, see above under What I Hoped under "What I Expected" above.)

What I Liked

OK, what I especially liked follows.

Chapters 1-5: I thought the first five chapters were quite good. They are really easy to follow, and they (especially in the first chapter) contain much useful perspective.

Learned Things: Although I had some degree of familiarity with PHP 4, I definitely learned some things about PHP 5. For example

  • I learned that SQLite is included with PHP 5 and have now played with it some.
  • I learned that there is an extension for running Perl programs.

References: I particularly appreciated the references, and, especially, the references to the online PHP manual. IMO, the online manual is too long and too thorough to serve as an introduction. However, it's ideal for when I wish to go deeper; the explanations are clear and I really find the comments after sections quite useful.

Gripes

Interactive?: The cover indicates the book is an introduction to "Building Interactive Web Sites". This is true, but might be misunderstood.

PHP (by itself) can't consistently provide the intense interaction that client-side JavaScript and Java applets can. Well, not until everyone has a blazingly fast connection to the Internet and the Internet stops hiccuping from time to time.

Chapters 6-13: After the first 5 chapters, I thought many of the chapters were tedious. I didn't think they were "Pain-Free" as advertised.

Please note, I'm not saying that these chapters are unreasonably hard. I am saying I think many readers would not find these chapters "Pain-Free".

HTML Reference for Beginners: The O'Reilly Definitive Guide for HTML and XHTML is recommended for those missing the HTML prerequisite. I think this is a bad recommendation because it goes into much more detail than is necessary to supply the prerequisite. Hey, it's 670 pages long.

Mail HTML: The example of mail includes HTML. Personally, I think HTML should be avoided in mail.

I'm well aware that not everyone feels that way.

Lack of Humor: I don't recall laughing or chuckling even once while reading the book. :( Some lightness would have been appreciated, especially in chapters 6-13.

Effect of PHP Tags: A statement in the first chapter seems to say that whatever is outside PHP tags is printed as is. This is not always the case and some of the cases where it is not are IMO important. I thought the chapter on Making Decisions would clarify this but it did not.

Who's the Book for?

This book would be good for someone

  • who has used HTML some to build websites (however simple)
  • who wants to build dynamic websites in the sense I described earlier
  • who wants to learn PHP
  • who perseveres

Some reasons for not getting this book might be

  • You don't know even basic HTML.
  • You aren't interested in building dynamic websites
  • You much prefer more traditional languages such as C to PHP.

Is this book for you? I'm not sure. How people learn varies from person to person. This is particularly important when learning something new.

Final Thoughts

This book is a good introduction to PHP. It does a very good job of introducing the fundamentals of the language. But since people learn so differently, I suggest checking this book out at your local technical bookstore if you can.

Last Updated: 2005-08-01