| Introduction |
|
1 | (4) |
| 1 Manipulating Strings |
|
5 | (32) |
|
|
|
6 | (1) |
|
Checking Usernames and Passwords |
|
|
7 | (2) |
|
Converting Strings into Hypertext Markup Language (HTML) |
|
|
9 | (2) |
|
|
|
11 | (1) |
|
|
|
12 | (1) |
|
|
|
13 | (3) |
|
|
|
16 | (1) |
|
Protecting Email Addresses Using ASCII Codes |
|
|
17 | (4) |
|
Scanning Formatted Strings |
|
|
21 | (1) |
|
Getting Detailed Information About Variables |
|
|
22 | (1) |
|
|
|
23 | (3) |
|
Using POSIX Regular Expressions |
|
|
26 | (2) |
|
Using Perl-Compatible Regular Expressions |
|
|
28 | (1) |
|
Finding Tags with Regular Expressions |
|
|
29 | (1) |
|
Validating Mandatory Input |
|
|
30 | (1) |
|
Validating Numbers (and Other Data Types) |
|
|
31 | (1) |
|
Validating Email Addresses |
|
|
32 | (2) |
|
|
|
34 | (3) |
| 2 Working with Arrays |
|
37 | (28) |
|
Accessing All Elements of Numerical Arrays |
|
|
39 | (1) |
|
Accessing All Elements of Associative Arrays |
|
|
40 | (1) |
|
Accessing All Array Elements in Nested Arrays |
|
|
41 | (3) |
|
Turning an Array into Variables |
|
|
44 | (1) |
|
Converting Strings to Arrays |
|
|
45 | (1) |
|
Converting Arrays to Strings |
|
|
46 | (1) |
|
Sorting Arrays Alphabetically |
|
|
47 | (1) |
|
Sorting Associative Arrays Alphabetically |
|
|
48 | (2) |
|
|
|
50 | (2) |
|
Sorting Nested Associative Arrays |
|
|
52 | (2) |
|
Sorting IP Addresses (as a Human Would) |
|
|
54 | (1) |
|
|
|
55 | (1) |
|
Sorting with Foreign Languages |
|
|
56 | (2) |
|
Applying an Effect to All Array Elements |
|
|
58 | (3) |
|
|
|
61 | (1) |
|
Getting Random Elements Out of Arrays |
|
|
62 | (3) |
| 3 Date and Time |
|
65 | (26) |
|
|
|
68 | (1) |
|
Automatically Localizing Dates |
|
|
69 | (3) |
|
Manually Localizing Dates |
|
|
72 | (1) |
|
Using the Current Date the U.S./U.K./European Way |
|
|
73 | (1) |
|
Formatting a Specific Date |
|
|
74 | (2) |
|
|
|
76 | (1) |
|
Calculating a Relative Date |
|
|
76 | (2) |
|
Creating a Sortable Time Stamp |
|
|
78 | (1) |
|
Converting a String into a Date |
|
|
79 | (1) |
|
Determining Sunrise and Sunset |
|
|
80 | (2) |
|
Using Date and Time for Benchmarks |
|
|
82 | (2) |
|
Using Form Fields for Date Selection |
|
|
84 | (1) |
|
Create Self-updating Form Fields for Date Selection |
|
|
85 | (3) |
|
Calculating the Difference Between Two Dates |
|
|
88 | (2) |
|
Using GMT Date/Time Information |
|
|
90 | (1) |
| 4 Interacting with Web Forms |
|
91 | (38) |
|
Sending Form Data Back to the Current Script |
|
|
92 | (1) |
|
|
|
93 | (2) |
|
Coping with "Magic Quotes" |
|
|
95 | (2) |
|
Checking Whether a Form Has Been Submitted |
|
|
97 | (1) |
|
Saving Form Data into a Cookie |
|
|
98 | (3) |
|
Prefilling Text Fields and Password Fields |
|
|
101 | (3) |
|
Prefilling Multiline Text Fields |
|
|
104 | (1) |
|
Preselecting Radio Buttons |
|
|
105 | (2) |
|
|
|
107 | (1) |
|
Preselecting Selection Lists |
|
|
108 | (2) |
|
Preselecting Multiple Selection Lists |
|
|
110 | (3) |
|
Processing Graphical Submit Buttons |
|
|
113 | (1) |
|
Checking Mandatory Fields |
|
|
114 | (2) |
|
|
|
116 | (3) |
|
Writing All Form Data into a File |
|
|
119 | (2) |
|
Sending All Form Data Via Email |
|
|
121 | (2) |
|
Getting Information About File Uploads |
|
|
123 | (3) |
|
Moving Uploaded Files to a Safe Location |
|
|
126 | (3) |
| 5 Remembering Users (Cookies and Sessions) |
|
129 | (40) |
|
|
|
130 | (2) |
|
|
|
132 | (1) |
|
|
|
133 | (2) |
|
Getting Rid of "Magic Quotes" in Cookies |
|
|
135 | (1) |
|
Setting a (Reasonable) Expiry Date |
|
|
136 | (1) |
|
Setting a Client-Specific Expiry Date |
|
|
137 | (2) |
|
|
|
139 | (1) |
|
Making Cookies Accessible for Several Domains |
|
|
140 | (2) |
|
Checking Whether the Client Supports Cookies |
|
|
142 | (2) |
|
Saving Multiple Data in One Cookie |
|
|
144 | (2) |
|
Saving the User's Language Preference |
|
|
146 | (2) |
|
|
|
148 | (1) |
|
Where to Store the Sessions |
|
|
149 | (1) |
|
How to Maintain the Session State |
|
|
150 | (1) |
|
|
|
151 | (1) |
|
Reading and Writing Sessions |
|
|
152 | (1) |
|
|
|
153 | (1) |
|
|
|
154 | (2) |
|
Creating Dynamic, Session-Aware Links |
|
|
156 | (1) |
|
Implementing a Custom Session Management |
|
|
157 | (6) |
|
Creating a Secured Area with Sessions |
|
|
163 | (2) |
|
Creating a Secured Area Without Sessions |
|
|
165 | (4) |
| 6 Using Files on the Server File System |
|
169 | (30) |
|
Opening and Closing Files |
|
|
170 | (4) |
|
|
|
174 | (1) |
|
|
|
175 | (3) |
|
|
|
178 | (1) |
|
Using Relative Paths for File Access |
|
|
179 | (1) |
|
Avoiding Security Traps with File Access |
|
|
180 | (1) |
|
|
|
181 | (4) |
|
|
|
185 | (2) |
|
Retrieving File Information |
|
|
187 | (2) |
|
Copying, Moving, and Deleting Files |
|
|
189 | (2) |
|
|
|
191 | (1) |
|
|
|
192 | (2) |
|
|
|
194 | (2) |
|
Returning Files with an HTTP Request |
|
|
196 | (3) |
| 7 Making Data Dynamic |
|
199 | (42) |
|
|
|
201 | (1) |
|
|
|
202 | (1) |
|
|
|
203 | (3) |
|
Prepared Statements with MySQL |
|
|
206 | (2) |
|
Retrieving Results of a Query to MySQL |
|
|
208 | (3) |
|
|
|
211 | (2) |
|
|
|
213 | (1) |
|
Retrieving Results of a Query to SQLite |
|
|
214 | (2) |
|
|
|
216 | (1) |
|
Sending SQL to PostgreSQL |
|
|
217 | (1) |
|
Updating Data in PostgreSQL |
|
|
218 | (1) |
|
Retrieving Results of a Query to PostgreSQL |
|
|
219 | (2) |
|
|
|
221 | (1) |
|
|
|
222 | (2) |
|
Retrieving Results of a Query to Oracle |
|
|
224 | (2) |
|
|
|
226 | (2) |
|
|
|
228 | (1) |
|
Retrieving Results of a Query to MSSQL |
|
|
229 | (2) |
|
|
|
231 | (1) |
|
|
|
232 | (1) |
|
Retrieving Results of a Query to Firebird |
|
|
233 | (1) |
|
|
|
234 | (2) |
|
|
|
236 | (1) |
|
Retrieving Results of a Query Via PDO |
|
|
237 | (4) |
| 8 Using XML |
|
241 | (16) |
|
|
|
242 | (3) |
|
Using DOM in PHP 4 to Read XML |
|
|
245 | (1) |
|
Using DOM in PHP 5 to Read XML |
|
|
246 | (2) |
|
Using DOM in PHP 4 to Write XML |
|
|
248 | (1) |
|
Using DOM in PHP 5 to Write XML |
|
|
249 | (1) |
|
|
|
250 | (2) |
|
Transforming XML with XSL and PHP 4 |
|
|
252 | (1) |
|
Transforming XML with XSL and PHP 5 |
|
|
253 | (1) |
|
|
|
254 | (3) |
| 9 Communicating with Others |
|
257 | (32) |
|
Connecting with HTTP Servers |
|
|
257 | (3) |
|
Connecting with FTP Servers |
|
|
260 | (3) |
|
Checking Whether a Server Is Still Reacting |
|
|
263 | (3) |
|
Creating a Web Service with PEAR:: XML-RPC |
|
|
266 | (2) |
|
Consuming a Web Service with PEAR:: XML-RPC |
|
|
268 | (2) |
|
Creating a Web Service with NuSOAP |
|
|
270 | (1) |
|
Automatically Generating WSDL with NuSOAP |
|
|
271 | (3) |
|
Consuming a Web Service with NuSOAP |
|
|
274 | (2) |
|
Creating a Web Service with PEAR:: SOAP |
|
|
276 | (1) |
|
Automatically Generating WSDL with PEAR:: SOAP |
|
|
277 | (2) |
|
Consuming a Web Service with PEAR:: SOAP |
|
|
279 | (1) |
|
Creating a Web Service with PHP 5's SOAP Extension |
|
|
280 | (3) |
|
Consuming a Web Service with PHP 5's SOAP Extension |
|
|
283 | (6) |
| Index |
|
289 | |