Programming PHP


This updated edition teaches everything you need to know to create effective web applications with the latest features in PHP 5.x. You’ll start with the big picture and then dive into language syntax, programming techniques, and other details, using examples that illustrate both correct usage and common idioms.

If you have a working knowledge of HTML, the authors’ many style tips and practical programming ...

See more details below
Paperback (Third Edition)
$29.59 price
(Save 26%)$39.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (22) from $10.50   
  • New (14) from $22.45   
  • Used (8) from $10.50   
Programming PHP

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$15.49 price
(Save 44%)$27.99 List Price


This updated edition teaches everything you need to know to create effective web applications with the latest features in PHP 5.x. You’ll start with the big picture and then dive into language syntax, programming techniques, and other details, using examples that illustrate both correct usage and common idioms.

If you have a working knowledge of HTML, the authors’ many style tips and practical programming advice will help you become a top-notch PHP programmer.

  • Get an overview of what’s possible with PHP programs
  • Learn language fundamentals, including data types, variables, operators, and flow control statements
  • Understand functions, strings, arrays, and objects
  • Apply common web application techniques, such as form processing, data validation, session tracking, and cookies
  • Interact with relational databases like MySQL or NoSQL databases such as MongoDB
  • Generate dynamic images, create PDF files, and parse XML files
  • Learn secure scripts, error handling, performance tuning, and other advanced topics
  • Get a quick reference to PHP core functions and standard extensions

PHP is a simple yet powerful open-source scripting language for creating dynamic Web content. PHP is used by both programmers, who appreciate its flexibility and speed, and Web designers, who value its accessibility and convenience. "Programming PHP" is an authoritative guide to the latest version of the language.

Read More Show Less

Editorial Reviews

From Barnes & Noble
The Barnes & Noble Review
Forty percent of all web applications run on PHP. With the major PHP 5 upgrade fully matured through several point releases, now’s the time to master PHP (or deepen your existing skills). Packed with both insight and code, Programming PHP, Second Edition is all you’ll need.

If you wish, you can start comfortably with the absolute basics: data types, variables, flow control, functions, strings, arrays. Or, focus on what’s new: there’s detailed coverage of PHP 5’s improvements in object and XML support; a quick briefing on PHP Data Objects, and a thoroughly modernized chapter on extending PHP.

Or simply use this book as a problem solver. Need to output PDF? It’s explained. Need to build a database application? There’s a ten-page case study. Need to secure your scripts against SQL injection, cross-site scripting, and other exploits? You’ll find surprisingly simple solutions. Bill Camarda, from the July 2006 Read Only

Read More Show Less

Product Details

  • ISBN-13: 9781449392772
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 2/27/2013
  • Edition description: Third Edition
  • Edition number: 3
  • Pages: 514
  • Sales rank: 381,160
  • Product dimensions: 6.90 (w) x 9.00 (h) x 0.70 (d)

Meet the Author

Kevin Tatroe has been a Macintosh and Unix programmer for ten years. He is an experienced PHP developer, knowledgeable in the changes coming with PHP 5. He is also co-author of the first edition of Programming PHP.

Peter MacIntyre lives and works in Charlottetown, Prince Edward Island, Canada. He has over 16 years of experience in the information technology industry, primarily in the area of software development.Peter's technical skill set includes several client/server tools and relational database systems such as PHP, PowerBuilder, Visual Basic, Active Server Pages, and CA-Visual Objects.Peter is certified by ZEND Corporation on PHP 4.x and has contributed writing material for Using Visual Objects (Que Corp.), Using PowerBuilder 5 (Que Corp.), ASP.NET Bible (Wiley Pub.), and Web Warrior Survey on Web Development Languages (Course Technology).Peter is also currently a contributing editor and author to the on-line and in-print magazine called php|architect ( He has also spoken several times at North American and International computer conferences including CA-World in New Orleans, USA; CA-TechniCon in Cologne, Germany; and CA-Expo in Melbourne, Australia.

Rasmus Lerdorf started the PHP Project back in 1995 and has been actively involved in PHP development ever since. Also involved in a number of other open source projects, Rasmus is a longtime Apache contributor and foundation member. He is the author of the first edition of the PHP Pocket Reference, and the co-author of the first edition of Programming PHP.

Read More Show Less

Table of Contents

Assumptions This Book Makes;
Contents of This Book;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Chapter 1: Introduction to PHP;
1.1 What Does PHP Do?;
1.2 A Brief History of PHP;
1.3 Installing PHP;
1.4 A Walk Through PHP;
Chapter 2: Language Basics;
2.1 Lexical Structure;
2.2 Data Types;
2.3 Variables;
2.4 Expressions and Operators;
2.5 Flow-Control Statements;
2.6 Including Code;
2.7 Embedding PHP in Web Pages;
Chapter 3: Functions;
3.1 Calling a Function;
3.2 Defining a Function;
3.3 Variable Scope;
3.4 Function Parameters;
3.5 Return Values;
3.6 Variable Functions;
3.7 Anonymous Functions;
Chapter 4: Strings;
4.1 Quoting String Constants;
4.2 Printing Strings;
4.3 Accessing Individual Characters;
4.4 Cleaning Strings;
4.5 Encoding and Escaping;
4.6 Comparing Strings;
4.7 Manipulating and Searching Strings;
4.8 Regular Expressions;
Chapter 5: Arrays;
5.1 Indexed Versus Associative Arrays;
5.2 Identifying Elements of an Array;
5.3 Storing Data in Arrays;
5.4 Multidimensional Arrays;
5.5 Extracting Multiple Values;
5.6 Converting Between Arrays and Variables;
5.7 Traversing Arrays;
5.8 Sorting;
5.9 Acting on Entire Arrays;
5.10 Using Arrays;
5.11 Iterator Interface;
Chapter 6: Objects;
6.1 Terminology;
6.2 Creating an Object;
6.3 Accessing Properties and Methods;
6.4 Declaring a Class;
6.5 Introspection;
6.6 Serialization;
Chapter 7: Web Techniques;
7.1 HTTP Basics;
7.2 Variables;
7.3 Server Information;
7.4 Processing Forms;
7.5 Setting Response Headers;
7.6 Maintaining State;
7.7 SSL;
Chapter 8: Databases;
8.1 Using PHP to Access a Database;
8.2 Relational Databases and SQL;
8.3 MySQLi Object Interface;
8.4 SQLite;
8.5 Direct File-Level Manipulation;
8.6 MongoDB;
Chapter 9: Graphics;
9.1 Embedding an Image in a Page;
9.2 Basic Graphics Concepts;
9.3 Creating and Drawing Images;
9.4 Images with Text;
9.5 Dynamically Generated Buttons;
9.6 Scaling Images;
9.7 Color Handling;
Chapter 10: PDF;
10.1 PDF Extensions;
10.2 Documents and Pages;
10.3 Text;
Chapter 11: XML;
11.1 Lightning Guide to XML;
11.2 Generating XML;
11.3 Parsing XML;
11.4 Parsing XML with DOM;
11.5 Parsing XML with SimpleXML;
11.6 Transforming XML with XSLT;
Chapter 12: Security;
12.1 Filter Input;
12.2 Cross-Site Scripting;
12.3 Escape Output;
12.4 Session Fixation;
12.5 File Uploads;
12.6 File Access;
12.7 PHP Code;
12.8 Shell Commands;
12.9 More Information;
12.10 Security Recap;
Chapter 13: Application Techniques;
13.1 Code Libraries;
13.2 Templating Systems;
13.3 Handling Output;
13.4 Error Handling;
13.5 Performance Tuning;
Chapter 14: PHP on Disparate Platforms;
14.1 Writing Portable Code for Windows and Unix;
14.2 Interfacing with COM;
Chapter 15: Web Services;
15.1 REST Clients;
15.2 XML-RPC;
Chapter 16: Debugging PHP;
16.1 The Development Environment;
16.2 The Staging Environment;
16.3 The Production Environment;
16.4 php.ini Settings;
16.5 Manual Debugging;
16.6 Error Log;
16.7 IDE Debugging;
16.8 Additional Debugging Techniques;
Chapter 17: Dates and Times;
Function Reference;
PHP Functions by Category;
Alphabetical Listing of PHP Functions;

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

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