Programming PHP, 2nd Edition
Creating Dynamic Web Pages
Publisher: O'Reilly Media
Final Release Date: April 2006
Pages: 542

Programming PHP, 2nd Edition, is the authoritative guide to PHP 5 and is filled with the unique knowledge of the creator of PHP (Rasmus Lerdorf) and other PHP experts. When it comes to creating websites, the PHP scripting language is truly a red-hot property. In fact, PHP is currently used on more than 19 million websites, surpassing Microsoft's ASP .NET technology in popularity. Programmers love its flexibility and speed; designers love its accessibility and convenience.

As the industry standard book on PHP, all of the essentials are covered in a clear and concise manner. Language syntax and programming techniques are coupled with numerous examples that illustrate both correct usage and common idioms. With style tips and practical programming advice, this book will help you become not just a PHP programmer, but a good PHP programmer. Programming PHP, Second Edition covers everything you need to know to create effective web applications with PHP. Contents include:

  • Detailed information on the basics of the PHP language, including data types, variables, operators, and flow control statements
  • Chapters outlining the basics of functions, strings, arrays, and objects
  • Coverage of common PHP web application techniques, such as form processing and validation, session tracking, and cookies
  • Material on interacting with relational databases, such as MySQL and Oracle, using the database-independent PEAR DB library and the new PDO Library
  • Chapters that show you how to generate dynamic images, create PDF files, and parse XML files with PHP
  • Advanced topics, such as creating secure scripts, error handling, performance tuning, and writing your own C language extensions to PHP
  • A handy quick reference to all the core functions in PHP and all the standard extensions that ship with PHP

Praise for the first edition:

"If you are just getting into the dynamic Web development world or youare considering migrating from another dynamic web product to PHP, Programming PHP is the book of choice to get you up, running, and productive in a short time."

--Peter MacIntrye, eWeek

"I think this is a great book for programmers who want to start developing dynamic websites with PHP. It gives a detailed overview of PHP, lots of valuable tips, and a good sense of PHP's strengths."

--David Dooling,

Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews


by PowerReviews
oreillyProgramming PHP, 2nd Edition

(based on 7 reviews)

Ratings Distribution

  • 5 Stars



  • 4 Stars



  • 3 Stars



  • 2 Stars



  • 1 Stars




of respondents would recommend this to a friend.


No Pros


  • Too many errors (3)

Best Uses

No Best Uses
    • Reviewer Profile:
    • Developer (4), Designer (3)

Reviewed by 7 customers

Displaying reviews 1-7

Back to top

(7 of 8 customers found this review helpful)


I will consider it a donation!

By Linda El duna

from Undisclosed

About Me Designer, Developer



    • Not comprehensive enough
    • Too basic
    • Too many errors

    Best Uses

    • None

    Comments about oreilly Programming PHP, 2nd Edition:

    Content is shallow and outdated by all means (unless you plan to work with a mentality of a php4 programmer).

    Poor examples, poor discussion of important topics, not comprehensive in any way.

    I am kinda surprised by the content, when I saw the big names on the cover of the book I thought the book is going to be awesome!

    (12 of 12 customers found this review helpful)


    Not what I expected

    By M.A

    from Amman, Jo

    About Me Developer, Sys Admin

    Verified Reviewer



      • Outdated
      • Too many errors

      Best Uses

        Comments about oreilly Programming PHP, 2nd Edition:

        I always go to O'Reilly when I need a good reference book, however this time I was disappointed.

        I bought the ebook which was released on: June 2009.

        From the first few pages I found myself correcting some errors here and there, many of the examples have typos and missing code.. Some of them are so obvious that you wonder who edited and reviewed the book and why did he ignore the mistakes.

        Also, the book makes you feel it is talking about php4 in some parts, the OOP part is not good enough for a PHP5 programmer..

        Before buying the book I was thinking of saving the money and buying few haskell ebooks to add to my collection like "Real World Haskell" and "Learn You a Haskell for Great Good". Instead I bought this book which short lived all my expectations.

        (3 of 4 customers found this review helpful)


        It also needs editing

        By Trickle

        from Wolfeboro, NH

        About Me Developer

        Verified Reviewer



          • Critical editing error

          Best Uses

            Comments about oreilly Programming PHP, 2nd Edition:

            I have been using O'Reilly books for over three decades and they are the first place I turn when I need a printed computer resource, so I was very surprised to find such a glaring problem with this one. On pages 406-407 is a listing of formatting characters recognized by the date() function. The function recognizes both lower and upper case characters and they are all listed, however the character column is ALL IN UPPER CASE! As a result, for those items which have both an upper and lower character entry they cannot be distinguished apart. I have only had the book two days and am fearful of what else I might find. Clearly this book was not carefully edited.

            (0 of 1 customers found this review helpful)


            this book needs an update

            By germanbookreader

            from berlin

            About Me Designer, Developer, Sys Admin


            • Good
            • Well-meant and away on a


            • Too many errors

            Best Uses

            • Intermediate
            • Novice
            • Student

            Comments about oreilly Programming PHP, 2nd Edition:

            at the beginning i have to say that i read that book in german. i habituate to that sometimes the code is armed with the german translation of the words in the code and with the english originals. this is usually in all of my germans translations, but it doesnt looks good if the books wants to be read with respect.

            Anyway. This book is confusing me at a new level. When all in the internet told me that php is one of the most simplistic languages than this book is hard to read.
            in chapter six about objects the authors told me that parameters given with the new object(x,y) expression the __constructor method will be called. and in the example above with the class person the code call person->__constructor and not person->__constructor and after that with the subclass the same procedere.
            This is one example of a lot of such things.

            I still be an oreilly fan and i will be an good reader of your books, because an askable thing here and there is good for thinking independent and learn the things more robust, but this book needs an update because there are things they shouldnt be there in my opinions.

            (0 of 3 customers found this review helpful)


            Mostly dessert with no main dish

            By Art

            from Plymouth, MA

            About Me Designer


            • Concise


            • Not comprehensive enough

            Best Uses

            • Intermediate

            Comments about oreilly Programming PHP, 2nd Edition:

            If you are looking for a book to start you journey into PHP, then this is not what you want. The examples show how and experienced programmer can baffle someone looking to start learning a new language. There is little illustrated to show you how to build a dynamic site, and much that you may need after learning PHP. This book was very disappointing when compared to the O'Reilly "In A Nutshell" type books.

            (1 of 2 customers found this review helpful)


            Definitely A Good Begginers Book.

            By Andr_s (Vermillion)

            from Undisclosed

            Comments about oreilly Programming PHP, 2nd Edition:

            After searching non-stop for tutorials on the internet about PHP, with no avail, or should I clarify, without finding any good tutorial on the internet, I decided to look up for a book that will help me learn PHP easily and without too many problems. "Programming PHP: Second Edition" is the first book that I found and definitely called my attention (not the animal on the cover... But that's definitely another story for another time).

            So I traveled to the US and I found this book on the US, as I couldn't import it due to the lack of a credit card. I started to read it, and it made things very simple. It teaches you the syntax, and the core features of the language in a concise and clear way.

            Although, like everyone trying to learn anything, needed or not, I did find some rocks on the field while trying to learn with this book, and unfortunately, the book didn't help me solve many of the problems I found. For instance, I could never use the graphics library for PHP because it seems I didn't have it installed back in that time, and the book does mention some weird command line stuff, but unfortunately, not everyone has a lot of knowledge on Command Lines. Personally I am illiterate when it comes to Command Lines, specially the Linux one (which is the one I believe the book shows you)... But come on! I am pretty sure a lot of the people that bought this book didn't even know what Linux was. It could have tough you a bit more about command line compiling for the PHP libraries you can get, and about the Linux Command Line. It definitely would have been a small yet useful knowledge.

            This book also covers the main pillars of OOP (Object Oriented Programming), and I have to say I am very satisfied for this, as with this pillars I actually did well when I saw OOP in C++. But after a while, I noticed the OOP part was not completed in a way, and considering the fact OOP is a first time complex concept for new programmers, they should have talked more about OOP and they should have given more examples regarding classes and objects/instantiation. Deeper coverage on abstraction and Polymorphism could have been very nice too.

            It covers the use of databases too, but for some reason they didn't mention MySQL at all, which is the most used Database system for PHP if I am not mistaken...

            Never the less, while it has its complex moments, and the OOP part is sort of incomplete, no one I know really takes a deep look at OOP the first time they see the concept. And even though the Database concepts are not really well covered, there are other books dedicated to that. The book still covers its main purpose of teaching PHP and the main features, and the syntax of course.

            I recommend this book to anyone that is interested in learning PHP and (probably) about the compatible databases with PHP. Though I recommend you use this book for PHP and just for PHP. The whole Databases part deals with objects and OOP, and not all of it is covered in the book.

            (6 of 7 customers found this review helpful)


            A comment about the style

            By Doug Lerner

            from Undisclosed

            Comments about oreilly Programming PHP, 2nd Edition:

            I am still just reading it. It seems like a useful book, but not as comprehensive, orderly and error-free as my O'Reilly "JavaScript" book is. Maybe the language itself is not as orderly. But it seems there are a lot of language notations that are used before being defined in a later chapter.

            I am still working my way through it and may come back and increase my rating of it later on (if possible), but for now I wanted to just mention one really annoying style matter that makes the code samples hard to read (and is the reason I decided to pause and write a review).

            This is a typic code sample (I bought the PDF version of the book):

            function update_counter () {

            static $counter = 0;


            echo "Static counter is now $counter\n";


            $counter = 10;



            echo "Global counter is $counter\n";

            Static counter is now 1

            Static counter is now 2

            Global counter is 10

            The last three lines are the result of running the code above it. Could that not be distinguished somehow? Could there not be a separator between the code and the results? Or could not a different type style be used? Or even add a line break and say "This results in:" or something like that?

            All the samples run the code and results together which make them difficult to read. I was surprised a format like that would be used.


            Displaying reviews 1-7

            Back to top

            Buy 2 Get 1 Free Free Shipping Guarantee
            Buying Options
            Immediate Access - Go Digital what's this?