Synopses & Reviews
This updated edition teaches everything you need to know to create effective web applications with the latest features in PHP 5.x. Youll 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 whats 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
About 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 (www.phparch.com). 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.
Table of Contents
Foreword; Preface; Audience; Assumptions This Book Makes; Contents of This Book; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; 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; Colophon;