Synopses & Reviews
Get past all the hype about PHP and dig into the real power of this language. This book explores the most useful features of PHP and how they can speed up the web development process, and explains why the most commonly used PHP elements are often misused or misapplied. You'll learn which parts add strength to object-oriented programming, and how to use certain features to integrate your application with databases.
Written by a longtime member of the PHP community, PHP: The Good Parts is ideal for new PHP programmers, as well as web developers switching from other languages.
- Become familiar with PHP's basic syntax, variables, and datatypes
- Learn how to integrate the language with web pages
- Understand how to use strings, arrays, and PHP's built-in functions
- Discover the advantages of using PHP as an object-oriented language
- Explore how PHP interacts with databases, such as SQLite and MySQL
- Learn input- and output-handling best practices to prevent security breaches
Synopsis
Get past all the hype about PHP and dig into the real power of the language. PHP: The Good Parts gives you a look at the most useful features of PHP, and explains how you can speed up the web development process with them. You'll learn why the most commonly used PHP features are often misused or misapplied, and which features add strength to object-oriented programming. You'll also focus on aspects that will help you integrate your application with databases.
PHP: The Good Parts is ideal for both new and experienced PHP programmers. If you've got experience using Java, Ruby, or another language to develop for the Web, you'll also benefit from this book, whether you're switching over to PHP or have inherited existing PHP code that you need to alter. No matter what your background in programming is, this is the go to guide to help you hone your PHP skills.
About the Author
Peter MacIntyre lives and works in Charlottetown, Prince Edward Island, Canada. He has over 20 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). Most recently he has co-authored the Zend Studio for Eclipse Developer's Guide - Addison-Wesley.
Peter is a former contributing editor and author to the on-line and in-print magazine called
Table of Contents
Dedication; Foreword; Preface; Conventions Used in This Book; Using Code Examples; How to Contact Us; Safari® Books Online; Acknowledgments; Chapter 1: The Good Parts; 1.1 Why PHP?; 1.2 Basic PHP Setup; Chapter 2: Casing the Joint; 2.1 Whitespace, Comments, and Basic Syntax; 2.2 Variables: Data Types, Loose Typing, and Scope; 2.3 Defined Constants; 2.4 Expressions; 2.5 Decisions, Decisions (Flow Control); 2.6 Integration with Web Pages; Chapter 3: Functions (Doing It Once); 3.1 Parameter Passing; 3.2 Default Parameters; 3.3 Passing by Value Versus Passing by Reference; 3.4 Include and Require; 3.5 Built-In Functions Versus UDFs; Chapter 4: Strings; 4.1 What Is a String?; 4.2 You Can Quote Me; 4.3 String Functions (Best of); Chapter 5: Arrays; 5.1 Indexed Arrays; 5.2 Associative Arrays; 5.3 Arrays from Another Dimension; 5.4 Arrays Can Be Dynamic; 5.5 Traversing Arrays; 5.6 Array Functions (Best of); Chapter 6: Objects; 6.1 Putting It into Practice; 6.2 Magic Methods; 6.3 $this; 6.4 Objects in Action; 6.5 Public, Protected, and Private; 6.6 Getters and Setters; Chapter 7: Database Interaction; 7.1 MySQLi Object Interface; 7.2 Retrieving Data for Display; 7.3 PHP Data Objects; 7.4 PDO Prepared Statements; 7.5 Data Management on the Cheap; 7.6 File Management As a Database Alternative; Chapter 8: PHP and Friends; 8.1 Email/SMS Generation; 8.2 PDF Generation; 8.3 Graphical Reports Generation; Chapter 9: PHP Security; 9.1 Data Validation; 9.2 Escape Output; 9.3 Cross-Site Scripting (XXS) and SQL Injection; 9.4 Password Encryption Security; 9.5 Security Tips; Chapter 10: PHP 5.3 Good Parts; 10.1 Namespaces; 10.2 Closures (Anonymous Functions); 10.3 NOWDOC; 10.4 goto Operator; 10.5 DateTime and DateTimeZone Classes; 10.6 Additional 5.3 Features; Chapter 11: Advanced Goodness; 11.1 Regular Expressions; 11.2 SimpleXML; 11.3 Integrated Development Environments; 11.4 Primary Websites; The Bad Parts; goto; Function Naming and Parameter Order; Loose Typing; Register Globals; Is That All?; Colophon;