Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Programming PHP

timothy posted more than 11 years ago | from the phwip-phwip-phwip dept.

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.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 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 Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

cancel ×


Sorry! There are no comments related to the filter you selected.


Anonymous Coward | more than 11 years ago | (#4244730)

NaveWeiss sucks


Yr0 (224662) | more than 11 years ago | (#4245026)


What about Perl? (-1, Troll)

Anonymous Coward | more than 11 years ago | (#4244733)

What we need is a review of "Perl 6 Quick Reference", none of this PHP crap.

Remote Object Calls. (0, Offtopic)

GrayCalx (597428) | more than 11 years ago | (#4244739)

PHP still doesn't have Remote Object calls correct?

Its pointless for all but smaller sites, businesses can't use it without remote calls.

Re:Remote Object Calls. (0)

Anonymous Coward | more than 11 years ago | (#4244769)

don't think so. Accessing multiple databases is more useful than accessing remote objects.

anyway, php at least has xmlrpc.

Re:Remote Object Calls. (2, Insightful)

ctembreull (120894) | more than 11 years ago | (#4244810)

This is true... and not true at the same time. I work for a large company (name withheld). We use it here, and quite successfully. I also worked for a large company prior to this one. We used it there, as well.

Lacking x feature or n widget doesn't necessarily stop businesses from using something, it just keeps them from using it for everything.

Re:Remote Object Calls. (1)

$rtbl_this (584653) | more than 11 years ago | (#4245214)

Me too. :)

I work for a Fortune 50 (no, there isn't a 0 missing off that) company and we use PHP quite a bit internally. I also do some freelance web work in my spare time with a friend who is a designer with no coding experience, and even he can get the basics of an interactive site together using PHP (provided I go in afterwards and secure things afterwards - sorry, Joss!) :)

PHP is fast, easy to use, feature-rich and well documented. Development of most simple interactive pages almost feels like cheating because there's generally a built-in function for anything you need to do. Now with the availability of database abstraction [] and templating [] most of my old complaints about it have been addressed and I find myself working with it more than Perl.

CORBA? (2)

mgkimsal2 (200677) | more than 11 years ago | (#4244884)

I could have sworn there was CORBA support (able to compile in CORBA support, anyway) but I can't find reference to it now. Has it gone?

Re:CORBA? (3, Informative)

ceejayoz (567949) | more than 11 years ago | (#4245309) 51 []

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?

The "X doesn't have Y" syndrome (2)

Pac (9516) | more than 11 years ago | (#4244900)

No, nothing has everything. On the other hand, "business" will do without almost anything as long as the task at hand gets done. PHP is not only excelent for business, it is wildly used in large e-commerce sites all over the world. Along with Perl, Python and Java servlets, it is one of the key web development technologies. It is very fast and very responsive. The lack of one or other feature may be a local problem, but it is not a general problem that allow you to classify it as "pointless"

Only inexperience makes one mix the "must have" column with the "nice to have" column. Or excessive press release reading. I have been using Java (Tomcat) and Python (by the way of Zope) in my recent projects, but I used PHP for years and it has always been adequate for small and large projects.

Re:Remote Object Calls. (2)

sporty (27564) | more than 11 years ago | (#4244912)

What makes it worse is they are trying to make it more OO by re-inventing the wheel. If they used an OO language underneath, they can make it more OO like.

PHP always acted like a complete hack of a language vs something that was engineered. Look at the database layer? No common functionality. Pear is cool and all, but by making the old calls avail, you allow users to still shoot themselves in the foot.

Sorry, bitter from trying to do enterprise programming with it.

To OOP or not to OOP (2, Insightful)

killmenow (184444) | more than 11 years ago | (#4245050)

When I read your post, I thought of C++...

A complete hack of a language. It's cool and all, but by making the old calls available, you allow users to still shoot themselves in the foot.

At any rate, I always thought the point of a good programming language was to give me a good gun for hitting the type of target I'm after...but if I want to aim it at my foot, well, c'est la vie.

Re:Remote Object Calls. (2)

einhverfr (238914) | more than 11 years ago | (#4245003)

Well, there is XML-RPC support as an extension (experimental) and there are several XML-RPC and SOAP classes available written in PHP.

I am writing a major web tools framework (see my sig), and I will be adding SOAP hooks for the applications as a whole and a SOAP engine as well (once the sample app is rewritten to be OO).

Re:Remote Object Calls. (1)

Azghoul (25786) | more than 11 years ago | (#4245012)

What a pathetic, arrogant attitude. Think /all/ businesses need remote calls? Think again.

Thinking more broadly, the vast majority of people in the U.S. work for small companies, and they certainly don't need super-mega-EJB-whatever huge technology is in vogue this week.

I think, beneath your silly comment, I'd suspect you'd admit you're in the "best tool for the job" crowd. But don't assume everyone's job is the same as yours.

Re:Remote Object Calls. (3, Informative)

kzanol (23904) | more than 11 years ago | (#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:Remote Object Calls. (0)

Anonymous Coward | more than 11 years ago | (#4245168)

It does include XML-RPC. That's enough.

Re:Remote Object Calls. (0)

Anonymous Coward | more than 11 years ago | (#4245181)

We used it do talk to a C++ server and do stuff...worked fine. Wrap your communications layer in a PHP "class" the same for your db're golden.

Re:Remote Object Calls. (3, Insightful)

Jobe_br (27348) | more than 11 years ago | (#4245287)

PHP is certainly not intended to be a middle-tier language, which is where remote calls would be most useful. That said, there's no reason some time couldn't be invested to find a work-around. Many C libraries can be wrapped with ease and accessed from PHP. Find a C library that allows for RPC (or remote object calls) and wrap it. Nevermind the ease with which Java classes integrate with PHP (its dead-simple) and Java's well known RMI (et al) support, you should be set.

As other posters have mentioned, PHP doesn't need to natively do *everything* - that just serves to bloat. But, it ought not *prevent* anything (which is Perl's mantra, too). For the most part, this is the case, especially with the Java integration. Between PHP and Java, if you find something that you can't do, I'd be most surprised. And if so - just use Perl :)


Re:Remote Object Calls. (3, Insightful)

killmenow (184444) | more than 11 years ago | (#4245295)

Its pointless for all but smaller sites, businesses can't use it without remote calls.
I am trying not to be offended by your arrogance. I take it you think smaller sites are all just hobbyists or bloggers?

I think your view is unbelievably pretentious considering that according to this [] the U.K. had 3.7 million active businesses in 2001 and of them 99.1% were small businesses (under 50 employees).

And, according to this [] in the USA:
  • there are approximately 25 million small businesses in the U.S.
  • new business formation reached another record level in 1998
  • there were 898,000 new employer businesses in 1998 -- the highest ever and a 1.5 percent increase over the record of 889,000 new businesses in 1997
  • In 1998, seven of the 10 industries which added the most new jobs were in sectors dominated by small businesses (U.S. Department of Labor, U.S. Department of Commerce)
  • small businesses hire a larger proportion of employees who are younger workers, older workers, women or workers who prefer to work part-time
  • small businesses provide 67 percent of workers with their first jobs and initial on the job training in basic skills
  • small business bankruptcies are the lowest in 19 years

Also, small businesses...

  • provide approximately 75 percent of the net new jobs added to the economy.
  • represent 99.7 percent of all employers.
  • employ 53 percent of the private work force.
  • provide 47 percent of all sales in the country.
  • provide 55 percent of innovations.
  • account for 35 percent of federal contract dollars.
  • account for 38 percent of jobs in high technology sectors.
  • account for 51 percent of private sector output.
  • represent 96 percent of all U.S. exporters.
Gee, now I see your point. You're right: PHP is useless to just about everybody out there.

PHP Security Papers (1, Interesting)

Anonymous Coward | more than 11 years ago | (#4244742) []

Contradiction in Review (2, Funny)

hether (101201) | more than 11 years ago | (#4244743)

Isn't this a contradiction:

This book provides good programmers who have never used PHP enough information to do serious web development using PHP


so if you want to use PHP but have never written any serious code, you may want to look elsewhere for an introduction

So is it good for newbies or not?

Re:Contradiction in Review (-1)

govtcheez (524087) | more than 11 years ago | (#4244749)

> So is it good for newbies or not?

::shaking head:: Yes.

Re:Contradiction in Review (5, Insightful)

alnapp (321260) | more than 11 years ago | (#4244763)

No contradiction:

You're an accomplished programmer but a PHP newbie then buy it.
Your a newbie to programming then there's prolly a "for dummies" out there.

Or, HIBT HIL and I'm having a nice day thank-you

No contradiction (2)

l-ascorbic (200822) | more than 11 years ago | (#4244772)

This book provides good programmers who have never used PHP enough information to do serious web development using PHP

Those who are experienced with another language will find this book useful for picking up PHP.

so if you want to use PHP but have never written any serious code, you may want to look elsewhere for an introduction

..if, however, you don't have experience in any programming language, you'd be best to find a book that spends more time covering coding basics.

Re:Contradiction in Review (1)

Grey Brick (311029) | more than 11 years ago | (#4244775)

Good for newbies to PHP, not newbies to programming.

Re:Contradiction in Review (1)

Spazholio (314843) | more than 11 years ago | (#4244789)

It's not a contradiction. It basically says that if you've ever written (good?) code, not necessarily in PHP, this is a good reference to get you introduced to the nuances of the language. However, if you're a total neophyte, and have never written code in any language, then this would not be the way to go.

Re:Contradiction in Review (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#4244826)

If you are a 'good programmer' then I assume who have written serious code at some point in time.

This book is destined to become a classic (4, Funny)

PhysicsGenius (565228) | more than 11 years ago | (#4244751)

It redefines the paradigm of online programming. Programming PHP, like PHP itself, marks a watershed in programming history. Generations from now technology historians will divide the time line into two periods: PPHP (Pre-PHP) and PPHP (Post-PHP). The PHP language, just like the book describing it, is beyond compare. Coupled together they have created a force for Good that rivals Superman, God and Scooby Doo all rolled into one. My next child is going to be named "PHP Programming Lastname".

Re:This book is destined to become a classic (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#4244799)

You left out the Holy Trinity of:

Foghorn Leghorn
and Otis from the Andy Griffin show

And who can forget Bob of the subgenius

Re:This book is destined to become a classic (-1, Offtopic)

kin_korn_karn (466864) | more than 11 years ago | (#4244846)

But will it foil the Axis of Evil? Will it stop Terrorism? Will the Enemy be dealt a crushing blow?

Re:This book is destined to become a classic (0)

Anonymous Coward | more than 11 years ago | (#4244948)

Can't believe people mod up this troll so often. Half intelligent trolling is the worst. Take a look at his past posts [] to see what I'm talking about. Sure, he may post something half-funny once in a while, but it's just so he gets above that -1 limit so he can troll some more. Argh.

Re:This book is destined to become a classic (1)

OmniVector (569062) | more than 11 years ago | (#4245031)

This THE definitive php book. it is so definitive, it redefines the definition of what definitive means.

Re:This book is destined to become a classic (0)

an_Allegory (42234) | more than 11 years ago | (#4245307)

There are good free refrences available, but having this quality reference in my hand has been a pleasing experience.

WOOT (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#4244755)


how relevant is PHP today? (-1, Flamebait)

jon_c (100593) | more than 11 years ago | (#4244773)

Quick poll, is how relevant is PHP in the world of web development today?

Re:how relevant is PHP today? (2)

onion2k (203094) | more than 11 years ago | (#4244801)

According to NetCraft, there are more PHP web sites than ASP.

Flamebait? (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#4244816)

Fuckin cmdtaco, this went from 1 -> flaimbait in 2 seconds. i hope you get meta-modded down.

How relevant is G. W. Bush Today? @# +1, Patriotic (0)

Anonymous Coward | more than 11 years ago | (#4244827)

Read more about the babbler-in-chief at:

The White House []

Thanks and have marijuana inspired day.

Re:how relevant is PHP today? (0, Offtopic)

kin_korn_karn (466864) | more than 11 years ago | (#4244860)

and BSD is dying

Re:how relevant is PHP today? (1)

NineNine (235196) | more than 11 years ago | (#4244887)

Netcraft knows nothing about intranets, which is where most real web development is done. I have yet to see a large company standardize on PHP, internally.

PHP installed != PHP being used (2)

dananderson (1880) | more than 11 years ago | (#4245306)

NetCraft reports are a poor measure, not because NetCraft is inaccurate, but many have out-of-the box installations (say from RedHat) that have PHP installed, use it or not. Many or most do not use PHP.

That said, I do have a gut feeling PHP is overcoming or overcame ASP.

Re:how relevant is PHP today? (0)

Anonymous Coward | more than 11 years ago | (#4244809)

This relevant []

thanks for the link (2)

jon_c (100593) | more than 11 years ago | (#4244845)

Though i'm not sure how they got those numbers it does show an interesting trend. PHP has been on the decline this year [] .

Also this doesn't relate well to other non-apache based tech's like ASP or ColdFusion.


Re:thanks for the link (0)

Anonymous Coward | more than 11 years ago | (#4245115)

I dispute the quality of the source here.

Check domain.html on the same www site.

According to that, the top two hosts suddenly increased their traffic by 130% in the last month... together with the proviso that due to their monitoring methods, sites may be counted twice...

The sudden growth in perl they show makes it all somewhat dubious, too - not that perl isn't popular, but I seriously down a sudden growth in usage last month...

Re:how relevant is PHP today? (2, Interesting)

caldroun (52920) | more than 11 years ago | (#4244812)

Are you kidding?
I work at a law firm full time, and that is all we use.
PHP is all I get requests for now, for outside work. (Actually less and less ASP crap, and no Cold Fusion)

Re:how relevant is PHP today? [OT] (1)

morgajel (568462) | more than 11 years ago | (#4244897)

That's very interesting... where approximately are you located? I'm in the Grand Rapids area myself, and all I can find as a web developer are asp gigs. I'd much rather use php and am generally interested in any area that would be looking for php developers,

Re:how relevant is PHP today? (0)

gregarine (171102) | more than 11 years ago | (#4244824)

I have used it on 2 small commercial websites. Coupled with mysql development was quick and painless. I think it a good tool for throwing up websites quickly or for prototyping sites. I havent used this combination on a site that gets heavy traffic. I would love to know how it would hold up.

Re:how relevant is PHP today? (1)

NineNine (235196) | more than 11 years ago | (#4244861)

I see ASP a hell of a lot more than I see PHP in my area.

Re:how relevant is PHP today? (2)

cscx (541332) | more than 11 years ago | (#4244889)

Tell me about it. PHP is good if you are running a small MySQL-based webzine but if you're doing e-Commerce or anything database-intensive, as most high-volume sites show, use ASP, JSP, or precompiled-binaries (in the case of eBay's ISAPI interface).

ASP is for people who don't mind paying for a good programming environment.

lol (1)

DrSkwid (118965) | more than 11 years ago | (#4244939)

ASP is for people who don't mind paying for a good programming environment.

Give me the unix programming environment before any version of Visual Studio.

It's been a while but last time I used IIS & ASP you couldn't even open a socket.

Re:lol (1)

NineNine (235196) | more than 11 years ago | (#4244998)

If your web application has to manually open a socket, then you completely screwed up the architecture, somewhere.

Re:lol (2)

cscx (541332) | more than 11 years ago | (#4245085)

IIRC, ASP does not allow direct sockets access for security purposes. If you really want to manipulate connections like that, write a server-side ActiveX Control. That's the "right" way to do it.

ASP (2)

Pac (9516) | more than 11 years ago | (#4244961)

You have probably never used PHP seriously, so you can be forgiven for your fast words. PHP is used in large commerce sites and large content sites all over the world.

Actually, ASP is for people who don't mind being locked in one operating platform, a problem PHP, Java , Python and Perl don't have. For your small projects it may not be an issue, but as projects grow bigger and more expensive, flexibility (pointedly cross-platform) quickly becomes a fundamental issue.

Re:ASP (1)

NineNine (235196) | more than 11 years ago | (#4245021)

Again, commerce sites are, by definition, simple, low volume applications. Content sites are even more lightwieght. Those are 1. no test of a language and 2. irrelevant as far as the job market is concerned.

One platform isn't a problem if the project is thought out and architected correctly. If you're jumping platforms midway through, somebody did a real half-assed job in the planning phase.

Time frame (2)

Pac (9516) | more than 11 years ago | (#4245148)

I think you are under the impression the "dotcom" style of software life-cycle (develop today, throw away tomorrow) is the market standard.

Well, it is not. In the real software development world, you don't plan for the next year, you plan at least for the next five years (more, if you are really smart). Or have you not noticed the Y2K panic was mostly caused by 20-30 year old software still being used in production environments?

There many compeling reasons to take cross-platform capabilities into account. There are measured data showing somewhere up the scale it is cheaper to buy a very expensive Sun or IBM machine than keep throwing Intel hardware at a problem. There is also the corporate climate changes and technological advances to take into account. And I am not talking just about Microsoft licensing problems, but also about the forseeable Linux future.

All in all, dismissing the possibility of platform exchange is a risk most large projects prefer not to take, specially because it is more and more an easily avoidable risk.

Re:Time frame (2)

NineNine (235196) | more than 11 years ago | (#4245284)

Well, with web apps, scalability *shouldn't* be a problem. The problem with most web apps is that they're written and architected wrong. Most that I've seen lean very heavily on the web server, thus that's the bottleneck, which is why you see server farms.

In reality, the bulk of any web app should be in the database. The majority of people building web apps know little to nothing about databases except for SELECT * FROM TABLENAME, so all of the heavy lifting is done at the web server. If databases are left to do what they're designed to do, and that's retrieving, AND manipulating data, then the web server becomes increasingly less important. If the app is designed correctly, different web servers should be able to hit the same databases with minimal coding done at the web server. Unfortunately, again, most people don't do this out of sheer ignorance. Thus, cross-platform shouldn't be a concern with web servers. Don't like like IIS for some reason, switch to Tomcat or Apache.

And this problem is also why you see so many people (at least in small projects) using a very feature and performance poor MySQL. A robust database, such as Oracle, SQL Server, or DB2 can do the work for you, with half of the hardware needed, and twice the performance. Heck, Oracle even has a web server and their own scripting language.

My experience is *not* with dot-com anything. My experience is with large, mission-critial web applications. Most large organizations have standardized on a platform, and don't just "switch". A major platform switch is a time consuming, expensive task that is only done when absolutely necessary. Thus, an application written that has an expected life, of say, 5 years, is very unlikely to be forced to move platforms within that time. Again, I'm talking about mature companies, not stuff started in people's basements.

Re:ASP (2)

cscx (541332) | more than 11 years ago | (#4245107)

Actually, ASP is for people who don't mind being locked in one operating platform

ASP runs on Windows, Solaris, and Linux. That's three.

Re:ASP (2)

cioxx (456323) | more than 11 years ago | (#4245282)

ASP runs on Windows, Solaris, and Linux. That's three.

Add *BSD to that list also. But of course you cannot run ASP 2/3.x w/o ChiliASP when dealing with non MS OSes.

ASP suxors (1, Flamebait)

The Ape With No Name (213531) | more than 11 years ago | (#4245024)

e-Commerce sites use ASP because they are developed by DBAs who are usually not programmers, but drag-and-droppers who understand control structures. It has nothing to do with the "intensity" of the work. Perl and Oracle are just as fast if you know what you are doing. Spank you very much, Trolly Trollerton.

Re:ASP suxors (1, Troll)

cscx (541332) | more than 11 years ago | (#4245064)

ASP + Oracle is even faster. Trust me, I've used it.

Re:ASP suxors (1, Troll)

Tablizer (95088) | more than 11 years ago | (#4245279)

(* ASP + Oracle is even faster. Trust me, I've used it. *)

Who says that you can't use PHP + Oracle?

One day (-1, Flamebait)

Anonymous Coward | more than 11 years ago | (#4244777)

One day I was standing in a Barnes and Noble looking at all the programming books.

I asked myself, "how many hours of internet time can I buy for the cost of one book?".

I learned plenty about perl using

The days of the book are dead.

Except for you folks stuck in the past. You don't think it's real if it's not on paper.

Come, join us in the 21st century. It's great here!

Be cool like Carl (Lerdorf) (-1, Troll)

Anonymous Coward | more than 11 years ago | (#4244803)

If this book interests you, of course, you can "Be cool like Carl [] ", son of Rasmus, shown absorbing PHP knowledge through osmosis. $fp = fopen("/dev/diaper", "w"); sleep(7200);

Useful, but not necessary (5, Informative)

$rtbl_this (584653) | more than 11 years ago | (#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 [] 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...

Re:Useful, but not necessary (1)

JazerWonkie (598827) | more than 11 years ago | (#4244873)

I agree completely with you. And to append on to what you said. Most books that come out on PHP are already out of date as far as the all the new functions that PHP has. This isn't a rib on the writers of the PHP books, it's just because of the time it takes to write the book, go through the publishing process and get the book shipped.

By then new functions have come out and the book that was supposed to cover PHP is now obsolete.

And again as much as I respect the writers and publishers of the PHP books, I find my times the comments below the functions on php's website to be more helpful than any book.

Re:Useful, but not necessary (1)

fungus (37425) | more than 11 years ago | (#4244894)

I used to read documentation with my laptop while in my bath. Way cheaper than buying those dead tree books.

I thought it was a good idea until I had to call tech support and they told me that it was not considered 'normal use' for the warranty. It only takes tech support people to say that taking a bath/shower is not normal I guess.

phew, get some soap (1, Offtopic)

DrSkwid (118965) | more than 11 years ago | (#4244920)

taking a bath/shower is not normal

Try a "Magic The Gathering" convention

Re:Useful, but not necessary (2)

iomud (241310) | more than 11 years ago | (#4244941)

If only all documentation was as good as the php website. Seriously it's fantastic, other languages should follow in it's example. I think it's a big factor of php's success myself. Recently I had some questions about apache 2 and php, I asked them on opn in #php and who answers me but rasmus himself. How cool is that? (Ok it's irc.. it can't be that cool but you know what I mean)

PHP reference (2, Interesting)

ProfitElijah (144514) | more than 11 years ago | (#4244828)

While I am sure that this is an excellent reference for PHP users, I'm sure I'm not the only one who thinks there is little point in buying a book on PHP when exists.

I saw this (4, Informative)

asv108 (141455) | more than 11 years ago | (#4244871)

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 [] doesn't provide.

Re:I saw this (-1)

Yr0 (224662) | more than 11 years ago | (#4244906)

there is still no substitute for dead tree if you dont have acres of screen real estate though.....

Re:I saw this (2)

Tablizer (95088) | more than 11 years ago | (#4245205)

but I figured that there is probably very little in the book that PHP's excellent online documentation [] doesn't provide.

I find books generally easier on the eyes than monitors. If I am going to be spending a lot of time with a language, then books make nice additions at times. Plus, you can read the book while waiting for somebody at the airport or the like.

Bah! (0)

Anonymous Coward | more than 11 years ago | (#4244885)

Continuing the tradition of well written O'Reilly 'Programming' books by those who know the language best[...]

Bah! Anyone can also do that these days: [] :)

Re:Bah! (1)

Pinball Wizard (161942) | more than 11 years ago | (#4245185)

That's hilarious. I only wish he had a turtle so I could create a more definitive "Programming Logo" cover.

Alternate Resource (1)

TheFlyingGoat (161967) | more than 11 years ago | (#4244888)

I've always found [] to answer all of my questions very effectively. The online manual has everything a manual should, plus additional comments from users. The comments contain everything from hints about how to use a function to complete code samples. Many other programming languages could benefit from similar sites.

Buy the book (2)

The Ape With No Name (213531) | more than 11 years ago | (#4244898)

and help pay Rasmus for his PHP, which is pretty cool. He gave a great tutorial at our university and parked PHP development all over the place. I love Perl like Madonna loves dick, but PHP is a good tool to have in the carpenter's box for many one-off projects and tasks that simply don't require Perl.

Tip (4, Informative)

Permission Denied (551645) | more than 11 years ago | (#4244913)

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: [] []

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.

Is this neccesary? (1, Redundant)

n-baxley (103975) | more than 11 years ago | (#4244918)

Is a PHP reference book really neccesary? With the excellent webpage they have I just see a book becoming outdated too fast. The only useful one would be the pocket reference edition of this book which I have but still use seldom.

Re:Is this neccesary? (1)

budcub (92165) | more than 11 years ago | (#4245022)

Everyone seems to be chimming in with "don't buy it, read it online". Am I the only person who can't stand reading books online or following online directions? I like to have a book open on the desk next to me while I'm trying something on the computer in front of me. I can't stand searching through a webpage when I can put a few post-its and highlights in a book and have the info just as fast, if not faster.

Re:Is this neccesary? (1)

Jobe_br (27348) | more than 11 years ago | (#4245207)

You're not alone, not by a long shot. Having an online reference is priceless (especially one edited by the users of a particular technology), but having a dead tree version is equally priceless. I'd hate to develop without either.

I reviewed this months ago (2)

truefluke (91957) | more than 11 years ago | (#4244922)

I have also given a 'quickie' review about this book months ago on out little site [] . You can also find the thread on signalnine by clicking on the 'reader reviews' link, on the book information page [] .

Quality questionable (0, Offtopic)

genkael (102983) | more than 11 years ago | (#4244926)

While I haven't read Programming PHP I found that PHP Pocket Reference, also put out by O'Reilly and written by Rasmus Lerdorf, was one of the worst books, and easilly the worst Pocket Reference, that I've every seen. The book is lacking information and content relative to the time that book was published. Function lists are incomplete and the descriptions are weak. With that said, you may want to think twice about purchasing the full sized book.

register_globals (1)

prof187 (235849) | more than 11 years ago | (#4244930)

i love php, it's what i program in all the time
but this decision on their part baffles me. why would they wait so late in development to remove register_globals as an option that can be turned on. i imagine that many people won't update because of this. and the ones who do may find some scripts not working. it seems that they should have made this decision a while back.

i know you can still use $HTTP_*_VARS w/ it turned off, but scripts that are using $username and $password from forms are going to be screwed, barring a cheap loop at the beginning.

Re:register_globals (1)

illogique (598061) | more than 11 years ago | (#4244976)

why would they wait so late in development to remove register_globals

because it's so hard to change people mind!!

and it was a cool feature before knowing the security issue...
and use $_* superglobal, they much cooler than $HTTP_*_VARS (except that they work only in php>=4.1)

Re:register_globals (1)

prof187 (235849) | more than 11 years ago | (#4244999)

yeah, i *try* to write any new scripts for any environment by doing

and oh, i know about changing people's minds, ugh...we recently changed from pegasus mail (ick!) to a web based mail. well, the complaints haven't stopped from a certain group of people who in the past. here's one of their arguments, "don't give me a bmw when all i need is a ford"

The Tattered Cover (0, Offtopic)

St. Vitus (26355) | more than 11 years ago | (#4244945)

Support [] bookstores [] that protect [] their customers' privacy.


Book vs. online manual (5, Interesting)

mgkimsal2 (200677) | more than 11 years ago | (#4244950)

There is no denying that the site is a good comprehensive resource. I do get tired of people suggesting to avoid books and just use the online manual. Obviously, they both have their places.

The first strike against the online manual is that it's not portable. Downloading in most of the portable formats loses the user contributed comments, which are really what make the online version as helpful as it is in most cases. Seeing how other people have worked around issues, or just posted small extra example snippets is often a lifesaver.

However, where books can come in useful is the depth. The biggest drawback of MOST PHP books is that they are thin on detail - sometimes a 500 page PHP book has less than 200 pages of 'useful' content, and often times its still elaborated examples of basic 'form submission' code. 200+ pages of reprinting the manual is often not useful for too many people. Yes, it's portable, but I don't need pages of mSQL commands, for example, printed in any book.

The few good books I've seen regarding PHP that are more in depth and less 'manuals' include the new Professional PHP4 XML (not perfect, but certainly useful if you need to do XML, although that's a moving target in PHP), PHP 4 Web Applications (from New Riders, kinda thin, but many good techniques over and above the usual PHP stuff) and a couple others which escape me. Probably only 20% of the books published actually contain useful stuff you won't find by combing the manual or various discussion boards.

Also, in defense of books, some people just learn better by being able to read and see examples (which is why the books should have more good examples and fewer filler pages of manual reprinting). Similarly some people do better with hands-on training than with forums or books, which (small plug) my company provides ( :)

Re:Book vs. online manual (2, Informative)

Stuart Gibson (544632) | more than 11 years ago | (#4245084)

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.


Books don't suck (2)

Infonaut (96956) | more than 11 years ago | (#4245112)

Some people, self included, simply grok things better when they have a book on the desk. Personally, I hate shifting back and forth between the code I'm trying to write, and online documentation. I don't have acres of screen real estate, and I find that it's easier to read a book for long stretches of text anyway.

I can read a book while I'm sitting on the back balcony, in a relaxed position away from any keyboards (yes, some Slashdot readers do step away from the computing devices from time to time). I can very easily annotate the book with this thing called a highlighter. I can even make notes in it with a special "pen" device.

Don't give me the expense argument either. Forty or fifty bucks for a good computer book is like an investment in your future employability. For most of us, this book will cost less than we'll bill for an hour or two of work.

If you don't like computer reference books, that's fine, but realize that for some of us, they're quite handy and worth the money.

Re:Books don't suck (1)

Jobe_br (27348) | more than 11 years ago | (#4245253)

Very nicely put. I'd like to chime in and say that reading programming books out on the deck is sweet. Yes, I could drag my 802.11b hooked-up Latitude or iBook out there, but its a lot easier to read a book when its *sunny* outside than it is to see an LCD screen! :)

Having a good library of computer books is about the best investment in ones future that any programmer can make. I've known of folks that grab a C programming manual that's easily 10 or more years old, just for the odd algorithm that showed up in there that they'd like to use for something. I've grabbed my old Ada83 books for info on setting up certain data structures easily.

To each their own!


bad book (0)

Anonymous Coward | more than 11 years ago | (#4244966)

I have a bunch of O'Reilly books (who doesn't) and out of dozen or so books, I felt this was the worst. The function section fails miserably in comparrison to the incredible Javascript function list.

I find the book basically says in Engligh what certain things in PHP do with not much in lines of examples or sample code to show how its done. I find after looking something up in this book, I have more questions then answers, and I find those answers quickly answered over within the posts over at

I wouldn't recommend this book to a beginner/intermediate/or advanced user. It lacks what beginners need to learn and its a terrible resource for those who know what they are doing but just need to check on syntax or a real world example...

shame too...

New global variables? (1)

Squeezer (132342) | more than 11 years ago | (#4244970)

Does this book cover the new global variables such as $_GET, $_POST, $_SESSION, $_COOKIE, $_REQUEST? While yes I know the docs at cover them, I'd like to have them in a book. Thats why I am waiting for PHP Fast and Easy 2nd edition by Julie Meloni,, because it covers them.

Re:New global variables? (1)

nitetide (550892) | more than 11 years ago | (#4245069)

It does. I have this book I use it all the time, I think it's a great reference. I've never read through it from front to back.

phwip-pwhip=pwhip (0, Offtopic)

G. Waters (172392) | more than 11 years ago | (#4244974)

Always thought it sounded more like "pshwep...pshwep...pshwep" "grwhirrrrl" etc.

Not to be confused with: "zurzeeeet-sheeeeeelt" "aaaaallullloight" "ruuaugh, fumchink-fumchink... poowah poowah poowah... slam! slam! slam!" "egh-heh" and the infamous " leiben!"

Anything like the blogger book? (1, Offtopic)

randomErr (172078) | more than 11 years ago | (#4244982)

This isn't like that blooger book for 1 credit that we saw here a couple of days ago?

Another good book (1)

Khalidz0r (607171) | more than 11 years ago | (#4244986)

A good PHP book I liked reading, and I still use for its function reference is "PHP4 Developer's Guide". I think it is for intermediate to advanced users because first time programers would really have a hard time understanding it.

good but not great (2)

mlong (160620) | more than 11 years ago | (#4245229)

Being the first edition, it does have some quirks to iron out which I have forwarded to the author. For example, it may talk about one alias to a function but not another, which would be helpful for Perl programmers and the like (for example, split is an alias to explode and join is an alias for implode). There were also a few issues with some of the functions in the book where they mixed up the argument order. Also I felt they didn't put near enough time into optimization, whereas the Perl book spends quite a few pages discussing it (I think the PHP one maybe had one page on it). There were some small things they skipped over which could make a difference in huge projects (when to use "" and when to use '') and whether to do print "$a$b$c" or print $a,$b,$c or print $a.$b.$c, etc. But overall this *is* the best PHP book I have read and I do look forward to their next edition.

PHP is the bomb. (0)

Anonymous Coward | more than 11 years ago | (#4245256)

PHP is Perl on Crack! You didn't know that?
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>