,TITLE.18349 Page i Wednesday, March 13, 2002 11:52 AM
Rasmus Lerdorf and Kevin Tatroe
with Bob Kaehms and Ric McGredy
Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
,TITLE.18349 Page iii Wednesday, March 13, 2002 11:52 AM
About the Authors
Rasmus Lerdorf was born in Godhavn/Qeqertarsuaq on Disco Island, off the coast
of Greenland, in 1968. He has been dabbling with Unix-based solutions since 1985.
He is known for having gotten the PHP project off the ground in 1995, and he can be
blamed for the ANSI-92 SQL-defying LIMIT clause in mSQL 1.x, which has now, at
least conceptually, crept into both MySQL and PostgreSQL.
Rasmus tends to deny being a programmer, preferring to be seen as a techie who is
adept at solving problems. If the solution requires a bit of coding and he can’t trick
somebody else into writing the code, he will reluctantly give in and write it himself.
He currently lives near San Francisco with his wife Christine.
Kevin Tatroe has been a Macintosh and Unix programmer for 10 years. Being lazy,
he’s attracted to languages and frameworks that do much of the work for you, such
as the AppleScript, Perl, and PHP languages and the WebObjects and Cocoa
Kevin, his wife Jenn, his son Hadden, and their two cats live on the edge of the rural
plains of Colorado, just far away enough from the mountains to avoid the worst
snowfall, and just close enough to avoid tornadoes. The house is filled with LEGO
creations, action figures, and numerous other toys.
Bob Kaehms has spent most of his professional career working with computers.
After a prolonged youth that he stretched into his late 20s as a professional scuba
diver, ski patroller, and lifeguard, he went to work as a scientific programmer for
Lockheed Missiles and Space Co. Frustrations with the lack of information-sharing
within the defense industry led him first to groupware and then to the Web.
Bob helped found the Internet Archive, where as Director of Computing he was
responsible for the first full backup of all publicly available data on the Internet. Bob
also served as Editor in Chief of Web Techniques Magazine, the leading technical
magazine for web developers. He is presently CTO at Media Net Link, Inc. Bob has a
degree in applied mathematics, and he uses that training to study the chaos that
exists around his house.
Ric McGredy founded Media Net Link, Inc. in 1994, after long stints at Bank of
America, Apple Computer, and Sun Microsystems, to pursue excellence in customer-
focused web-service construction and deployment. While he has been known to
crank out a line or two of code, Ric prides himself first and foremost as being busi-
ness-focused and on integrating technology into the business enterprise with high
reliability at a reasonable cost.
Ric received a BA in French from Ohio Wesleyan University and has been involved
in the accounting and information-technology disciplines for over 25 years. Ric lives
near San Francisco with his wife Sally and five children.
,AUTHOR.COLO.18074 Page 1 Wednesday, March 13, 2002 11:52 AM
Our look is the result of reader comments, our own experimentation, and feedback
from distribution channels. Distinctive covers complement our distinctive approach
to technical topics, breathing personality and life into potentially dry subjects.
The animal on the cover of Programming PHP is a cuckoo (Cuculus canorus).
Cuckoos epitomize minimal effort. The common cuckoo doesn’t build a nest—
instead, the female cuckoo finds another bird’s nest that already contains eggs and
lays an egg in it (a process she may repeat up to 25 times, leaving 1 egg per nest). The
nest mother rarely notices the addition, and usually incubates the egg and then feeds
the hatchling as if it were her own. Why don’t nest mothers notice that the cuckoo’s
eggs are different from their own? Recent research suggests that it’s because the eggs
look the same in the ultraviolet spectrum, which birds can see.
When they hatch, the baby cuckoos push all the other eggs out of the nest. If the
other eggs hatched first, the babies are pushed out too. The host parents often
continue to feed the cuckoo even after it grows to be much larger than they are, and
cuckoo chicks sometimes use their call to lure other birds to feed them as well. Inter-
estingly, only Old World (European) cuckoos colonize other nests—the New World
(American) cuckoos build their own (untidy) nests. Like many Americans, these
cuckoos migrate to the tropics for winter.
Cuckoos have a long and glorious history in literature and the arts. The Bible
mentions them, as do Pliny and Aristotle. Beethoven used the cuckoo’s distinctive
call in his Pastoral Symphony. And here’s a bit of etymology for you: the word
“cuckold” (a husband whose wife is cheating on him) comes from “cuckoo.”
Presumably, the practice of laying one’s eggs in another’s nest seemed an appro-
Rachel Wheeler was the production editor and copyeditor for Programming PHP.
Sue Willing and Jeffrey Holcomb provided quality control, and Sue Willing provided
production assistance. Ellen Troutman-Zaig wrote the index.
Ellie Volckhausen designed the cover of this book, based on a series design by Edie
Freedman. The cover image is a 19th-century engraving from the Dover Pictorial
Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using
Adobe’s ITC Garamond font.
Melanie Wang designed the interior layout, based on a series design by David
Futato. Neil Walls converted the files from Microsoft Word to FrameMaker 5.5.6
using tools created by Mike Sierra. The text font is Linotype Birka; the heading font
is Adobe Myriad Condensed; and the code font is LucasFont’s TheSans Mono
Condensed. The illustrations that appear in the book were produced by Robert
Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop
6. This colophon was written by Nathan Torkington and Rachel Wheeler.
,AUTHOR.COLO.18074 Page 2 Wednesday, March 13, 2002 11:52 AM