Zend's new PHP 5 Certification Exam represent an excellent tool for professional PHP developers who want to distinguish themselves in their field. php|architect's Zend PHP 5 Certification Study Guide, edited and produced by the publishers of php|architect magazine, provides the most comprehensive and thorough preparation tool for developers who wish to take the exam. This book provides complete coverage of every topic that is part of the exam, including: ? PHP Basics ? Functions ? Arrays ? Strings and Patterns ? Web Programming ? Object Oriented Programming ? Database Programming ? Object-oriented Design ? XML and Web Services ? Security ? Streams and Network Programming ? Differences Between PHP 4 and 5 Written by PHP professionals and Zend Certified PHP 5 Engineers Davey Shafik and Ben Ramsey, and reviewed by core PHP developer Derick Rethans, this is the perfect book for every prospective Zend Certified PHP Engineer candidate! Contents......Page 6 Foreword......Page 16 How To Use This Book......Page 18 Source Files and PHP Tags......Page 22 Anatomy of a PHP Script......Page 24 Whitespace......Page 25 Language Constructs......Page 26 Numeric Values......Page 27 Booleans......Page 29 Converting Between Data Types......Page 30 Variables......Page 31 Variable Variables......Page 32 Constants......Page 33 Operators......Page 34 Arithmetic Operators......Page 35 The String Concatenation Operator......Page 36 Bitwise Operators......Page 37 Referencing Variables......Page 39 Comparison Operators......Page 40 Logical Operators......Page 42 Other Operators......Page 43 Operator Precedence and Associativity......Page 44 Control Structures......Page 45 Conditional Structures......Page 46 Iterative Constructs......Page 48 Breaking and Continuing......Page 50 Types of Errors......Page 51 Error Reporting......Page 52 Handling Errors......Page 53 Summary......Page 54 Basic Syntax......Page 56 Returning Values......Page 57 Variable Scope......Page 58 Passing Arguments......Page 60 Variable-length Argument Lists......Page 61 Passing Arguments by Reference......Page 62 Summary......Page 64 Array Basics......Page 66 Printing Arrays......Page 67 Enumerative vs. Associative......Page 68 Unravelling Arrays......Page 69 Array Operations......Page 70 Comparing Arrays......Page 71 Counting, Searching and Deleting Elements......Page 72 Flipping and Reversing......Page 74 The Array Pointer......Page 75 An Easier Way to Iterate......Page 77 Passive Iteration......Page 78 Sorting Arrays......Page 80 Other Sorting Options......Page 82 The Anti-Sort......Page 84 Arrays as Stacks, Queues and Sets......Page 86 Set Functionality......Page 88 Summary......Page 89 String Basics......Page 92 Variable Interpolation......Page 93 Escaping Literal Values......Page 94 Determining the Length of a String......Page 95 Using Strings as Arrays......Page 96 Comparing, Searching and Replacing Strings......Page 97 Simple Searching Functionality......Page 98 Simple Search and Replace Operations......Page 100 Extracting Substrings......Page 102 Formatting Numbers......Page 103 Formatting Currency Values......Page 104 Generic Formatting......Page 106 Perl-compatible Regular Expressions......Page 108 Metacharacters......Page 109 Quantifiers......Page 110 Matching and Extracting Strings......Page 111 Using PCRE to Replace Strings......Page 113 Summary......Page 114 Anatomy of a Web Page......Page 116 Forms and URLs......Page 117 GET and URLs......Page 118 Using POST......Page 119 When You Don't Know How Data Is Sent......Page 120 Managing File Uploads......Page 121 HTTP Headers......Page 123 Compression......Page 124 Caching......Page 125 Cookies......Page 126 Sessions......Page 128 Summary......Page 129 OOP Fundamentals......Page 132 Instantiating an Object......Page 133 Class Inheritance......Page 134 Class Methods and Properties......Page 135 Constructors......Page 137 Destructors......Page 138 Visibility......Page 139 Declaring and Accessing Properties......Page 141 Constants, Static Methods and Properties......Page 142 Interfaces & Abstract Classes......Page 143 Interfaces......Page 145 The Basic Exception Class......Page 147 Throwing Exceptions......Page 149 Lazy Loading......Page 151 Reflection......Page 153 Summary......Page 158 An Introduction to Relational Databases and SQL......Page 160 Indices......Page 161 SQL Data Types......Page 162 Creating Databases and Tables......Page 164 Creating Indices and Relationships......Page 165 Dropping Objects......Page 166 Adding and Manipulating Data......Page 167 Removing Data......Page 168 Retrieving Data......Page 169 SQL Joins......Page 170 Outer Joins......Page 171 Advanced Database Topics......Page 172 Prepared Statements......Page 173 Summary......Page 174 Design Pattern Theory......Page 176 The Singleton Pattern......Page 177 The Factory Pattern......Page 178 The Registry Pattern......Page 179 The Model-View-Controller Pattern......Page 180 The Standard PHP Library......Page 181 Accessing Objects as Arrays......Page 182 Simple Iteration......Page 183 Seekable Iterators......Page 184 Recursive Iteration......Page 185 Filtering Iterators......Page 187 Summary......Page 188 XML and Web Services......Page 190 The Extensible Markup Language (XML)......Page 191 Creating an XML Document......Page 193 SimpleXML......Page 195 Parsing XML Documents......Page 196 Accessing Children and Attributes......Page 197 XPath Queries......Page 199 Modifying XML Documents......Page 200 Working With Namespaces......Page 201 DOM......Page 202 Loading and Saving XML Documents......Page 203 XPath Queries......Page 204 Modifying XML Documents......Page 205 Moving Data......Page 206 Modifying Data......Page 207 Removing Data......Page 208 Working With Namespaces......Page 209 Interfacing with SimpleXML......Page 210 SOAP......Page 211 Accessing SOAP-based Web Services......Page 212 Debugging......Page 213 Creating SOAP-based Web Services......Page 214 REST......Page 216 Summary......Page 217 Concepts and Practices......Page 220 Whitelist vs. Blacklist Filtering......Page 221 Filter Input......Page 222 Escape Output......Page 224 Register Globals......Page 226 Spoofed Forms......Page 227 Cross-Site Scripting......Page 229 Cross-Site Request Forgeries......Page 230 Database Security......Page 232 Session Security......Page 233 Filesystem Security......Page 235 Remote Code Injection......Page 236 Command Injection......Page 237 Shared Hosting......Page 238 Summary......Page 239 Streams and Network Programming......Page 242 Accessing Files......Page 244 Common C-like File Functions......Page 246 Simple File Functions......Page 248 Working with Directories......Page 249 Controlling File Access......Page 250 Simple Network Access......Page 252 Advanced Stream Functionality......Page 253 Stream Filters......Page 254 Summary......Page 255 Language Features......Page 258 Magic Methods......Page 259 Selected New Extensions......Page 260 Error Management......Page 261 Index......Page 264 Contents 6 Foreword 16 How To Use This Book 18 PHP Basics 22 Syntax 22 Source Files and PHP Tags 22 Newline Characters 24 Anatomy of a PHP Script 24 Comments 25 Whitespace 25 Code Block 26 Language Constructs 26 Data Types 27 Numeric Values 27 Strings 29 Booleans 29 Compound Data Types 30 Other Data Types 30 Converting Between Data Types 30 Variables 31 Variable Variables 32 Determining If a Variable Exists 33 Constants 33 Operators 34 Arithmetic Operators 35 The String Concatenation Operator 36 Bitwise Operators 37 Assignment Operators 39 Referencing Variables 39 Comparison Operators 40 Logical Operators 42 Other Operators 43 Operator Precedence and Associativity 44 Control Structures 45 Conditional Structures 46 Iterative Constructs 48 Breaking and Continuing 50 Errors and Error Management 51 Types of Errors 51 Error Reporting 52 Handling Errors 53 Summary 54 Functions 56 Basic Syntax 56 Returning Values 57 Variable Scope 58 Passing Arguments 60 Variable-length Argument Lists 61 Passing Arguments by Reference 62 Summary 64 Arrays 66 Array Basics 66 Printing Arrays 67 Enumerative vs. Associative 68 Multi-dimensional Arrays 69 Unravelling Arrays 69 Array Operations 70 Comparing Arrays 71 Counting, Searching and Deleting Elements 72 Flipping and Reversing 74 Array Iteration 75 The Array Pointer 75 An Easier Way to Iterate 77 Passive Iteration 78 Sorting Arrays 80 Other Sorting Options 82 The Anti-Sort 84 Arrays as Stacks, Queues and Sets 86 Set Functionality 88 Summary 89 Strings And Patterns 92 String Basics 92 Variable Interpolation 93 The Heredoc Syntax 94 Escaping Literal Values 94 Determining the Length of a String 95 Transforming a String 96 Using Strings as Arrays 96 Comparing, Searching and Replacing Strings 97 Simple Searching Functionality 98 Matching Against a Mask 100 Simple Search and Replace Operations 100 Extracting Substrings 102 Formatting Strings 103 Formatting Numbers 103 Formatting Currency Values 104 Generic Formatting 106 Parsing Formatted Input 108 Perl-compatible Regular Expressions 108 Delimiters 109 Metacharacters 109 Quantifiers 110 Sub-Expressions 111 Matching and Extracting Strings 111 Using PCRE to Replace Strings 113 Summary 114 Web Programming 116 Anatomy of a Web Page 116 Forms and URLs 117 GET and URLs 118 Using POST 119 When You Don't Know How Data Is Sent 120 Managing File Uploads 121 GET or POST? 123 HTTP Headers 123 Redirection 124 Compression 124 Caching 125 Cookies 126 Sessions 128 Summary 129 Object Oriented Programming in PHP 132 OOP Fundamentals 132 Declaring a Class 133 Instantiating an Object 133 Class Inheritance 134 Class Methods and Properties 135 Constructors 137 Destructors 138 Visibility 139 Declaring and Accessing Properties 141 Constants, Static Methods and Properties 142 Class Constants 143 Interfaces & Abstract Classes 143 Interfaces 145 Determining An Object's Class 147 Exceptions 147 The Basic Exception Class 147 Throwing Exceptions 149 Lazy Loading 151 Reflection 153 Summary 158 Database Programming 160 An Introduction to Relational Databases and SQL 160 Indices 161 Relationships 162 SQL Data Types 162 Creating Databases and Tables 164 Creating Indices and Relationships 165 Dropping Objects 166 Adding and Manipulating Data 167 Removing Data 168 Retrieving Data 169 SQL Joins 170 Outer Joins 171 Advanced Database Topics 172 Transactions 173 Prepared Statements 173 Summary 174 Elements of Object-oriented Design 176 Design Pattern Theory 176 The Singleton Pattern 177 The Factory Pattern 178 The Registry Pattern 179 The Model-View-Controller Pattern 180 The ActiveRecord Pattern 181 The Standard PHP Library 181 Accessing Objects as Arrays 182 Simple Iteration 183 Seekable Iterators 184 Recursive Iteration 185 Filtering Iterators 187 Summary 188 XML and Web Services 190 The Extensible Markup Language (XML) 191 Creating an XML Document 193 SimpleXML 195 Parsing XML Documents 196 Accessing Children and Attributes 197 XPath Queries 199 Modifying XML Documents 200 Working With Namespaces 201 DOM 202 Loading and Saving XML Documents 203 XPath Queries 204 Modifying XML Documents 205 Moving Data 206 Modifying Data 207 Removing Data 208 Working With Namespaces 209 Interfacing with SimpleXML 210 Web Services 211 SOAP 211 Accessing SOAP-based Web Services 212 Debugging 213 Creating SOAP-based Web Services 214 REST 216 Summary 217 Security 220 Concepts and Practices 220 All Input Is Tainted 221 Whitelist vs. Blacklist Filtering 221 Filter Input 222 Escape Output 224 Register Globals 226 Website Security 227 Spoofed Forms 227 Cross-Site Scripting 229 Cross-Site Request Forgeries 230 Database Security 232 Session Security 233 Filesystem Security 235 Remote Code Injection 236 Command Injection 237 Shared Hosting 238 Summary 239 Streams and Network Programming 242 Accessing Files 244 Common C-like File Functions 246 Simple File Functions 248 Working with Directories 249 Controlling File Access 250 Accessing Network Resources 252 Simple Network Access 252 Stream Contexts 253 Advanced Stream Functionality 253 Stream Filters 254 Summary 255 Differences Between PHP 4 and 5 258 Language Features 258 Objects 259 Magic Methods 259 Selected New Extensions 260 Error Management 261 Index 264
zend's New Php 5 Certification Exam Represent An Excellent Tool For Professional
php Developers Who Want To Distinguish Themselves In Their Field.
php|architect's Zend Php 5 Certification Study Guide, Edited And Produced By
the Publishers Of Php|architect Magazine, Provides The Most Comprehensive And
thorough Preparation Tool For Developers Who Wish To Take The Exam.
this Book Provides Complete Coverage Of Every Topic That Is Part Of The Exam,
including:
? Php Basics
? Functions
? Arrays
? Strings And Patterns
? Web Programming
? Object Oriented Programming
? Database Programming
? Object-oriented Design
? Xml And Web Services
? Security
? Streams And Network Programming
? Differences Between Php 4 And 5
written By Php Professionals And Zend Certified Php 5 Engineers Davey Shafik And
ben Ramsey, And Reviewed By Core Php Developer Derick Rethans, This Is The Perfect
book For Every Prospective Zend Certified Php Engineer Candidate!