Core PHP Programming: A New Perspective on Object-Oriented Design


Foreword by Andi Gutmans

The experienced developer's guide to PHP!

Master PHP 4, the open source, high-performance, cross-platform solution for server-side scripting!

Core PHP Programming, Second Edition is the #1 practical guide to PHP 4 for Web developers. With the guidance of top PHP developer Leon Atkinson, you'll learn everything you'll need to build robust, fast Web ...

See more details below
Available through our Marketplace sellers.
Other sellers (Other Format)
  • All (19) from $1.99   
  • New (6) from $9.05   
  • Used (13) from $1.99   
Sort by
Page 1 of 1
Showing 1 – 4 of 6
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2006

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

"Massive softcover. Second edition, ISBN: 0130893986. Pristine condition. No wear. No crease on spine. No markings. No remainder mark. Seal on CD-ROM in back of book is intact. ... Shipped with USPS tracking." Read more Show Less

Ships from: Holmdel, NJ

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2008

Feedback rating:


Condition: New

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2015

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2015

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing 1 – 4 of 6
Sort by
Sending request ...


Foreword by Andi Gutmans

The experienced developer's guide to PHP!

Master PHP 4, the open source, high-performance, cross-platform solution for server-side scripting!

Core PHP Programming, Second Edition is the #1 practical guide to PHP 4 for Web developers. With the guidance of top PHP developer Leon Atkinson, you'll learn everything you'll need to build robust, fast Web applications — and deploy them on leading Web servers, from Apache to Microsoft Internet Information Server.

Atkinson covers PHP syntax, the key building blocks of PHP scripts, and every PHP function, including I/O, data, and math functions, time, date, configuration, database, graphics, and network functions. He presents PHP at work in sample code that demonstrates sorting, searching, parsing, string evaluation, and more. You'll even find detailed, real-world insights into PHP 4 program design and debugging!

Core PHP Programming delivers

  • Thorough, easy-to-understand coverage of PHP syntax and functions
  • Step-by-step guidance for PHP database integration
  • Design and optimization techniques for maximum performance and extensibility
  • Practical debugging solutions
CD-ROM includes PHP 4 source code and Windows binaries plus all the code examples from the book!
Read More Show Less

Editorial Reviews

A book/CD-ROM guide to PHP 4 for Web developers, covering essentials for building Web applications and deploying them on leading Web servers, including Apache and Microsoft Internet Information Server. Covers PHP syntax, PHP scripts, and I/O, data, and math functions, and time, date, configuration, database, graphics, and network functions. Presents PHP at work in sample code that demonstrates sorting, searching, parsing, and string evaluation. Also gives insights into PHP 4 program design and debugging. The CD-ROM contains source code and code examples. Atkinson is creator of an e-commerce toolkit. Annotation c. Book News, Inc., Portland, OR (
Read More Show Less

Product Details

  • ISBN-13: 9780130893987
  • Publisher: Pearson Education
  • Publication date: 8/4/2000
  • Series: Core Series
  • Edition description: Older Edition
  • Edition number: 2
  • Pages: 769
  • Product dimensions: 7.02 (w) x 9.32 (h) x 2.16 (d)

Meet the Author

Leon Atkinson is Chief Technologist for Clear Ink Corporation, an agency offering traditional and Web communication services. He is creator and maintainer of the FreeTrade project, an Open Source e-commerce toolkit, and an enthusiastic supporter of PHP.
Read More Show Less

Read an Excerpt

Chapter 1: An Introduction to PHP

This chapter will introduce you to PHP. You will learn how it came about, what it looks like, and why it is the best server-side technology. You will also be exposed to the most important features of the language.

PHP began as a simple macro replacement tool. Like a nice pair of shoes, it got you where you needed to go, but you could go only so far. On the hyperspeed development track of the Internet, PHP leas become the equivalent of a 1960s muscle, car. It's cheap, it's fast, and there's plenty of room under the hood for you and your virtual wrench.

You probably don't need convincing that whether it's Internet, intranet, or extranet, the Web is no longer about plain HTML files. Web pages arc being replaced with Web applications. The issue many Web engineers face is choosing among hundreds of technologies.

This chapter will let you poke around the PHP engine., get your hands a little dirty, and take it for a spin. There are lots of small examples you can try immediately. Like all the examples in this book, you can easily adapt them to provide real solutions. Don't be intimidated if you don't fully understand the. PHP code at first. Later chapters will deal with all the issues in detail. This chapter talks about some things that you already know, like what a computer is, just to make sure we're all on the same page. You may be a wizzard with HTML, but not fully appreciate the alien way computers arc put together. Or you tray find you learned all these things in a high school computer class. If you get too. bored with the basics, skip to Chapter 2, " Variables, Operators, and Expressions."

The Origins of PPP

Wonderful things come from singular inspiration. PPP began life as a simple way to track visitors to Rasmus Lerdorfs online resume. It also could embed SQL queries in Web pages. But as often happens on the Web, admirers quickly asked for their own copies. As a proponent of the Internet's ethic of sharing, as well as a generally agreeable person, Rasmus unleashed upon an unsuspecting Web his Personal Home Page Tools version 1.0.

"Unleashed upon himself" may be more accurate. PPP became very popular. A consequence was a flood of suggestions. PPP 1.0 filtered input, replacing simple commands for HTML. As its popularity grew, people wondered if it couldn't do more. Loops, conditionals, rich data structures-all the conveniences of modern structured programming seemed like a next logical step. Rasmus studied language parsers, read about YACC and GNU Bison, and created PPP 2.0.

PPP 2.0 allowed developers to embed structured code inside. HTML tags. PPP scripts could parse data submitted by HTML forms, communicate with databases, and make complex calculations on the fly. And it was very fast, because the freely available source code compiled into the Apache Web server. A PPP script executed as part of the Web server process and required no forking, often a criticism of Common Gateway Interface (CGI) scripts.

PPP was a legitimate development solution and began to be, used for commercial Web sites. In 1996 Clear Ink created the SuperCuts site (www. supercuts.corn) and used PPP to created a custom experience for the Web surfer. In January of 1999 the PPP Web site reported almost 100,000 Web servers were using PPP By November that figure lead climbed higher than 350,000 A community of developers grew up around PHP Feature requests were balanced by bug fixes and enhancements Zeev Suraski and Audi Gutmaris made a significant contribution by writing a new parser. They observed that the parser in PHP 2.0 was the source of many problems. Rasmus decided to begin work on PPP 3.0 and called for developers to commit to its creation. Along with Zeev and Audi, three others lent their support: Stig Bakken, Shane Caraveo, and Jim Winstead....

Read More Show Less

Table of Contents


1. An Introduction to PHP.
The Origins of PHP. What Makes PHP Better than Its Alternatives. Interfaces to External Systems. How PHP Works with the Web Server. Hardware and Software Requirements. Installation on Apache for UNIX. Installation on IIS for Windows NT. Editing Scripts. Algorithms. What a PHP Script Looks Like. Saving Data for Later. Receiving User Input. Choosing between Alternatives. Repeating Code. Conclusion.

2. Variables, Operators, and Expressions.
Identifiers. Data Types. Variable Creation and Scope. Assigning Values to Variables. Retrieving Values. Freeing Memory. Constants. Operators. Logical and Relational Operators. Bitwise Operators. Miscellaneous Operators. Assignment Operators. Expressions.

3. Control Statements.
True and False. The if Statement. The ? Operator. The switch Statement. Loops. The while Statement. The break Statement. The continue Statement. The do while Statement. The for Statement. The foreach Statement. exit, die, and return. Evaluation of Boolean Expressions.

4. Functions.
Declaring a Function. The return Statement. Scope and the global Statement. Arguments. Recursion. Dynamic Function Calls.

5. Arrays.
Single-Dimensional Arrays. Indexing Arrays. Initializing Arrays. Multidimensional Arrays. Casting Arrays. Referencing Arrays Inside Strings.

6. Classes and Objects.
Defining a Class. Creating an Object. Accessing Properties and Methods.

7. I/O and Disk Access.
HTTP Connections. Writing to the Browser. Output Buffering. Environment Variables. Getting Input from Forms. Cookies. File Uploads. PUT Method Requests. Reading and Writing to Files. Sessions. The includeand require Functions.


8. I/O Functions.
Sending Text to the Browser. Output Buffering. Files. Compressed File Functions. POSIX. Debugging. Session Handling. Shell Commands. HTTP Headers. Network I/O. FTP.

9. Data Functions.
Data Types, Constants, and Variables. Arrays. Hashing. Strings. Encoding and Decoding. Encryption. Regular Expressions. Perl-Compatible Regular Expressions.

10. Mathematical Functions.
Common Math. Random Numbers. Arbitrary-Precision Numbers.

11. Time, Date, and Configuration Functions.
Time and Date. Alternative Calendars. Configuration.

12. Image Functions.
Analyzing Images. Creating JPEG, PNG, and WBMP Images.

13. Database Functions.
dBase. DBM-style Database Abstraction. filePro. Informix. InterBase. mSQL. MySQL. ODBC. Oracle. Postgres. Sybase.

14. Miscellaneous Functions.
Apache. Aspell. COM. Gettext. IMAP. Java. LDAP. Semaphores. Shared Memory. SNMP. WDDX. XML.


15. Sorting, Searching, and Random Numbers.
Sorting. Bubble Sort. Quicksort. Built-In Sorting Functions. Sorting with a Comparison Function. Searching. Indexing. Random Numbers. Random Identifiers. Choosing Banner Ads.

16. Parsing and String Evaluation.
Tokenizing. Regular Expressions. Defining Regular Expressions. Using Regular Expressions in PHP Scripts.

17. Database Integration.
Building HTML Tables from SQL Queries. Tracking Visitors with Session Identifiers. Storing Content in a Database. Database Abstraction Layers.

18. Network.
HTTP Authentication. Controlling Browser Cache. Setting Document Type. Email with Attachments. Verifying an Email Address.

19. Generating Graphics.
Dynamic Buttons. Generating Graphs on the Fly. Bar Graphs. Pie Charts. Stretching Single-Pixel Images.


20. Integration with HTML.
Sprinkling PHP within an HTML Document. Using PHP to Output All HTML. Separating HTML from PHP. Creating Fields. Passing Arrays in Forms.

21. Design.
Writing Requirements Specifications. Writing Design Documents. Using CVS. Modularization Using include. FreeEnergy. FastTemplate. Midgard. Ariadne. Preserving State and Providing Security. Cloaking. URLs Friendly to Search Engines. Running a Script Regularly.

22. Efficiency and Debugging.
Measuring Performance. Fetching Database Query Results. When to Store Content in a Database. In-Line Debugging. Remote Debugging. Simulating HTTP Connections.

Appendix A.
Appendix B.
Appendix C.
Appendix D.
Appendix E.
Appendix F.
Appendix G.

Read More Show Less


My first inkling that I might like to write a book about PHP was born out of the frustration I felt with the original PHP manual. It was a single, large HTML file with all the functions in alphabetical order. It was also on a Web server thousands of miles away from me in Canada, so it was slow to show up in my browser, even across a T1 connection. It wasn't long before it was saved on my desktop. After struggling for several months, it started to dawn on me that I could probably organize the information into a more usable format. Around that time the next version of PHP began to take shape, and with it a new manual was developed. It was organized around PHP's source code but was less complete than the old PHP manual. I contributed descriptions for some of the missing functions, but I still had the idea to write my own manual. In the spring of 1998 Prentice Hall PTR gave me the opportunity to do so. It is an honor for my book to be among Prentice Hall classics such as The C Programming Language by Brian Kernighan and Dennis Ritchie.

This book assumes a certain familiarity with the Internet, the Web, and HTML programming, but it starts with the most basic ideas of programming. It will introduce you to concepts common to all programming languages and how they work in PHP. You can expect this book to teach you how to create rich, dynamic Web sites. You can also expect it to remain on your desk as a reference for how PHP works, or even as a recipe book for solving common design problems.

This book is not for dummies, nor is it for complete idiots. That you are considering PHP is a great indication of your intelligence, and I'd hate toinsult it. Some of the ideas in this book are hard to understand. If you don't quite get them the first time, I encourage you to reread and experiment with the examples.

If you are uncomfortable writing HTML files, you may wish to develop this skill first. Marty Hall's Core Web Programming provides an excellent introduction. Beyond HTML, numerous other topics I touch on fall out of scope. Whenever I can, I suggest books and Web sites that provide more information. There are even some aspects of PHP that range too far from the focus on writing PHP scripts. An example is writing extensions for PHP in C. This involves a healthy knowledge of C programming that I cannot provide here. Related to this is compiling and installing PHP. I attempt to describe the process of installing PHP, which can involve compiling the source code, but I can't attempt to pursue all the different combinations of operating system, Web servers, and extensions. If you are comfortable running make files, you will find the information that comes with the PHP source code more than adequate.

Along with the explanation text I've provided real-world examples. Nothing is more frustrating than trying to adapt some contrived academic problem to the Web site you must have working by the end of the week. Some of the examples are based on code from live Web sites I have worked on since discovering PHP in 1997. Others are distilled from the continual discussion being conducted on the PHP mailing lists.

This book is organized into four main sections: an introduction to programming; a reference for all the functions in PHP; a survey of common programming problems; and finally a guide for applying this knowledge to Web site development. The first section deals with the issues involved with any programming language: what a PHP script looks like; how to control execution; how to deal with data. The second section organizes the functions by what they do and gives examples of their use. PHP offers many functions, so this section is larger than the rest. The third section deals with solving common programming problems such as sorting and generating graphics. The last section offers advice about how to create a whole Web site with PHP.

I've chosen a few conventions for highlighting certain information, and I'm sure you will find them obvious, but for the sake of clarity I'll spell them out. Whenever I use a keyword such as the name of a script or a function, I place it in a monospace font. For example, I may speak about the print function. Another convention I've used is to place email addresses and Web addresses inside angle brackets. Examples are the email address by which you can contact me, <>, and my Web site

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted March 3, 2001

    Only book u ever needed

    very good book for beginner.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)