Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
PHP Books Media Programming Book Reviews

Programming PHP 228

dooling writes "Continuing the tradition of well written O'Reilly 'Programming' books by those who know the language best, Programming PHP, co-written by the creator of PHP, Rasmus Lerdorf, provides a detailed overview of the popular PHP web-page scripting language. This book provides good programmers who have never used PHP enough information to do serious web development using PHP and serves as an excellent reference for web-page designers who dabble in PHP." Read on for the rest of his review.
Programming PHP
author Rasmus Lerdorf & Kevin Tatroe
pages 507
publisher O'Reilly and Associates
rating 7
reviewer dooling
ISBN 1565926102
summary great PHP book for serious programmers, good reference
While not as entertaining as Programming Perl, it isn't nearly as long either (and doesn't have to be). The book is written in a straightforward style and is very well organized. Appendices provide quick reference to all the PHP built-in functions and many PHP extensions. The most popular extensions, e.g., PEAR DB (database connectivity) and XML, have entire chapters devoted to them. Can't find a PHP extension for your favorite library? There's a chapter about writing your own PHP extensions, including writing C library wrappers.

This book begins as most O'Reilly "Programming" books do: with a brief introductory chapter. In Programming PHP, this chapter is very short, so don't look to this book for a gentle introduction. On the other hand, this is the perfect book for you if you are just looking to learn a new scripting language. The following chapters go over syntax, data types, built-in functions, etc. These chapters are a little dry, but move quickly and effectively demonstrate the unique features of PHP (as compared to other scripting languages).

Of particular interest to programmers who are interested in expanding their horizons to developing dynamic web pages are the chapters on PHP web techniques, security, and application techniques. The web techniques chapter gives a quick overview of HTML and the GET and POST methods (and why you would want to use one or the other). It then covers a lot of useful tips and tricks that may be foreign to someone who has done little or no web development. Topics such as getting server information, form processing, sticky forms, file uploads, document expiration, and authentication are covered. It ends with an excellent discussion of maintaining state from page to page and visit to visit, covering cookies and PHP's (very cool) session support.

The security chapter covers standard things you want to keep in mind when creating dynamic HTML. No surprises here, but it is always good to be reminded. The application techniques chapter starts with a collection of best-practices, tips, and tricks to make your development process easier and better. It concludes with sections about error handling and performance tuning. As with the security chapter, there is nothing here a good programmer doesn't already know, but you can never hear it too many times.

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

As someone who has written a lot of code, but only a little CGI, I really liked the chapters that discussed application development techniques specific to the web. Along those lines, not much time is spent on standard coding techniques, so if you want to use PHP but have never written any serious code, you may want to look elsewhere for an introduction. For the rest of you, just think, you may never have to use CGI.pm again.

The index seems adequate, although I must admit I did not use it much on the first read-through. The book is so well organized that, when reading it, you do not have to flip around much. Perhaps someone who has used this book as a reference can comment further on the quality of the index.

Contents are available on O'Reilly's page Links

See Rasmus's page for links to where you can buy the book (maybe he gets a kickback for the link). Of course, you could always go to a local bookstore and purchase it.


You can purchase Programming PHP from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

This discussion has been archived. No new comments can be posted.

Programming PHP

Comments Filter:
  • by $rtbl_this ( 584653 ) on Thursday September 12, 2002 @11:14AM (#4244806)

    As a semi-competent Perl hacker I found PHP very easy to pick up, and I imagine the same would be true for anyone with some degree of coding experience. The only reference I find myself using regularly is the excellent PHP website [php.net] which provides a pretty decent tutorial and a thorough and searchable command reference. Combine that with the fact that the manual is annotated by PHP users and the only reason for having a dead tree reference is to have something to read in the bath.

    Still, buying it does at least give Rasmus some money...

  • I saw this (Score:4, Informative)

    by asv108 ( 141455 ) <asv@nOspam.ivoss.com> on Thursday September 12, 2002 @11:24AM (#4244871) Homepage Journal
    The other day while I was waiting for a friend a Barnes and Noble, I picked it up only to put it back on the shelf ten minutes later. Usually I buy every Oreilly book for technologies that I use frequently, but I figured that there is probably very little in the book that PHP's excellent online documentation [php.net] doesn't provide.
  • Tip (Score:4, Informative)

    by Permission Denied ( 551645 ) on Thursday September 12, 2002 @11:32AM (#4244913) Journal
    PHP's online documentation is excellent. Their website has this very useful feature where you don't even have to have a window open to it when you're doing web development: simply type in the name of the function you want:

    www.php.net/mysql_query [php.net]
    www.php.net/strftime [php.net]

    I've found this most useful: you only have to type a few more keys besides the function name to get the documentation, kind of like man pages.

  • by Stuart Gibson ( 544632 ) on Thursday September 12, 2002 @12:00PM (#4245084) Homepage
    My personal favourite is the Windows help version of the PHP manual which DOES include the user comments if you get the right version. Since there seems to be nearly as much activity surounding the production of this version as there is of PHP itself, it is well worth checking regularly for updated versions. If you're working offline, this is much better than any book can ever be. Like PHP, the Windows help version is wonderfully designed and easy to use.

    Goblin
  • by kzanol ( 23904 ) on Thursday September 12, 2002 @12:06PM (#4245141)
    PHP still doesn't have Remote Object calls correct? What sort of Remote object calls do you need?
    • xmlrpc: works
    • SOAP (via http, https or smtp transport): works
    • CORBA (ORBit / satellite): works
    I've probably overlooked some more but it should still get you started :-)
  • Re:CORBA? (Score:3, Informative)

    by ceejayoz ( 567949 ) <cj@ceejayoz.com> on Thursday September 12, 2002 @12:27PM (#4245309) Homepage Journal
    http://freshmeat.net/projects/php-orbit/?topic_id= 51 [freshmeat.net]

    PHP-ORBit is a PHP4 module which can be used to easily access services that communicate via CORBA. This is achieved by wrapping the lightweight CORBA ORB "ORBit" used in GNOME.

    Isn't Google just great?
  • by Rasmus ( 740 ) on Thursday September 12, 2002 @06:29PM (#4247857) Homepage
    Before starting PHP I had actually done quite a bit of database programming using various languages including Perl. And I agree that database abstraction is useful in some cases, but as soon as your database needs go beyond trivial selects it all falls apart. Try switching from M$-SQL to Oracle halfway through a project. The fact that you used a database abstraction layer might save you 10 minutes of global search and replace on some db-specific function calls, but then you spend the next 3 weeks converting your schemas, stored procedures, triggers and the SQL itself. Try taking an Oracle query that includes DECODE() and make it work on some other database! A DB abstraction layer doesn't solve any of this.
    (Well, some try to solve the schema issue by forcing you to describe it in some generic XML format, but you still need to get in there and get your hands dirty to make sure the different types each db supports are handled correctly)
    When I write applications I write it with the databases I want it to run on in mind. I write database-specific functions to fetch data, update data, etc. I do this so I can use all the DB-specific performance tricks I can. And I will simply state that this application supports MySQL, PostgreSQL and Oracle, for example. If someone comes later on and tells me it needs to support another one, ok, then I add that support. For most dynamic web apps the bottleneck is the database. I am completely unwilling to trade performance for portability on that particular aspect. You don't trade away performance on the one critical factor in your architecture.

    So, that is why database abstraction is not in the core of PHP and why PHP gives you access to all the intricacies of each database API. Others have layered abstraction layers on top of this low-level API support and that is fine, but PHP was originally designed as a tool for me to solve web problems and as such the design reflected my approach to web-database integration.

    If every database conformed to standards and the SQL and schemas were portable, then yes, not using db abstraction would be asinine, but that is not the case, and it will never be the case as database vendors always want to distinguish their product from the next guy's.

Solutions are obvious if one only has the optical power to observe them over the horizon. -- K.A. Arsdall

Working...