did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780672328176

PHP Phrasebook

by
  • ISBN13:

    9780672328176

  • ISBN10:

    0672328178

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2005-09-26
  • Publisher: Addison-Wesley Professional
  • View Upgraded Edition
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $24.99

Summary

If you were traveling in Spain, but couldn't speak Spanish very well, you'd probably carry a Spanish dictionary with you. If you are a PHP developer who needs a portable reference guide for frequent use in your job, thePHP Phrasebookis perfect for you. ThePHP Phrasebookis actually a pocket guide that is jam-packed with useful and essential PHP code "phrases" for the PHP developer's everyday use. The code is flexible, so it can be easily adapted to your needs and mulitple situations, and your time isn't wasted wading through chapters of tutorial lessons and extraneous information. The phrasebook covers PHP 5 and is relevant for PHP 4.

Author Biography

Christian Wenz is professional developer, trainer and consultant with a focus on web technologies. He frequently contributes articles to renowned IT magazines and speaks at conferences around the world. Christian is Germany's very first Zend Certified Professional and contributes to several PHP packages in the PEAR repository. Christian has written or contributed to several books on PHP and related technologies, including PHP 5 Unleashed.

Table of Contents

Introduction 1(4)
1 Manipulating Strings 5(32)
Comparing Strings
6(1)
Checking Usernames and Passwords
7(2)
Converting Strings into Hypertext Markup Language (HTML)
9(2)
Using Line Breaks
11(1)
Encrypting Strings
12(1)
Checksumming Strings
13(3)
Extracting Substrings
16(1)
Protecting Email Addresses Using ASCII Codes
17(4)
Scanning Formatted Strings
21(1)
Getting Detailed Information About Variables
22(1)
Searching in Strings
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)
Search and Replace
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)
Sorting Nested Arrays
50(2)
Sorting Nested Associative Arrays
52(2)
Sorting IP Addresses (as a Human Would)
54(1)
Sorting Anything
55(1)
Sorting with Foreign Languages
56(2)
Applying an Effect to All Array Elements
58(3)
Filtering Arrays
61(1)
Getting Random Elements Out of Arrays
62(3)
3 Date and Time 65(26)
Using Text Within date()
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)
Validating a Date
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)
Reading Out Form Data
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)
Preselecting Check Boxes
107(1)
Preselecting Selection Lists
108(2)
Preselecting Multiple Selection Lists
110(3)
Processing Graphical Submit Buttons
113(1)
Checking Mandatory Fields
114(2)
Checking Selection Lists
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)
Understanding Cookies
130(2)
Creating a Cookie
132(1)
Reading Out Cookies
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)
Deleting a Cookie
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)
Understanding Sessions
148(1)
Where to Store the Sessions
149(1)
How to Maintain the Session State
150(1)
Activating Sessions
151(1)
Reading and Writing Sessions
152(1)
Closing Sessions
153(1)
Changing the Session ID
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)
Reading from Files
174(1)
Writing to Files
175(3)
Locking Files
178(1)
Using Relative Paths for File Access
179(1)
Avoiding Security Traps with File Access
180(1)
Working with CSV Data
181(4)
Parsing INI Files
185(2)
Retrieving File Information
187(2)
Copying, Moving, and Deleting Files
189(2)
Browsing the File System
191(1)
Using PHP Streams
192(2)
Using Bzip2 Archives
194(2)
Returning Files with an HTTP Request
196(3)
7 Making Data Dynamic 199(42)
Connecting to MySQL
201(1)
Connecting to MySQLi
202(1)
Sending SQL to MySQL
203(3)
Prepared Statements with MySQL
206(2)
Retrieving Results of a Query to MySQL
208(3)
Connecting to SQLite
211(2)
Sending SQL to SQLite
213(1)
Retrieving Results of a Query to SQLite
214(2)
Connecting to PostgreSQL
216(1)
Sending SQL to PostgreSQL
217(1)
Updating Data in PostgreSQL
218(1)
Retrieving Results of a Query to PostgreSQL
219(2)
Connecting to Oracle
221(1)
Sending SQL to Oracle
222(2)
Retrieving Results of a Query to Oracle
224(2)
Connecting to MSSQL
226(2)
Sending SQL to MSSQL
228(1)
Retrieving Results of a Query to MSSQL
229(2)
Connecting to Firebird
231(1)
Sending SQL to Firebird
232(1)
Retrieving Results of a Query to Firebird
233(1)
Connecting Via PDO
234(2)
Sending SQL Via PDO
236(1)
Retrieving Results of a Query Via PDO
237(4)
8 Using XML 241(16)
Parsing XML with SAX
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)
Using SimpleXML
250(2)
Transforming XML with XSL and PHP 4
252(1)
Transforming XML with XSL and PHP 5
253(1)
Validating XML
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

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

= 0) {slash = '\\';} else {slash = '/';}openLoc = figLoc.substring(0, figLoc.lastIndexOf(slash) + 1);while (pPage.substring(0,3) == '../') {openLoc = openLoc.substring(0, openLoc.lastIndexOf(slash, openLoc.length - 2)+ 1);pPage = pPage.substring(3, pPage.length + 1);}popUpWin =window.open('','popWin','resizable=1,scrollbars=1,location=0,toolbar=0,width=525,height=394');figDoc = popUpWin.document;zhtm= ' ' + pPage + ' ';zhtm += ' ';zhtm += ' ';zhtm += ' ';zhtm += '' + pPage.substring(pPage.lastIndexOf('/') + 1, pPage.length) + '';zhtm += ' ';figDoc.write(zhtm);figDoc.close();}// modified 3.1.99 RWE v4.1 --> Introduction IntroductionSome time ago, my favorite development editor, Damon Jordan, sent me an email and closed it with "Ich mouml;chte eine Fouml;hnwelle"--"I'd like a blow wave." Unfortunately, I didn't know what either a Fouml;hnwelle or a blow wave is, so I declined. He then told me he had found this sentence in a German phrasebook he recently bought.I was interested and had a look at some German phrasebooks. I think they are great tools to get around in a foreign country, although I personally think that some of the phrases offered just don't make sense. For instance, in one phrasebook, I found a series of pickup lines, including the ingenious "You have a beautiful personality," something that didn't work for me either in English, in German, or in any other language! Some coital guidance could also result in other problems--you either have to remember all the things to say while you are at it, or you have to hold the phrasebook in your free hand. And, finally, "Blow waves are as dead as a pet rock," just to use another phrase.Anyway, we were discussing phrasebooks a bit, and Damon said that he wanted to do a book series on phrasebooks. He also mentioned that he would like to team up with his and my favorite acquisitions editor, Shelley Johnston, so I was in.While working on a concept, we found some differences between a language phrasebook and an IT phrasebook. For instance, a language phrasebook just contrasts the same sentence in two languages. However, this is not always helpful. What if you want to change the phrase a bit, for instance if you want an en vogue blow wave (an oxymoron, one might say)?So, we tried to create a concept that contains a lot of phrases, but all of them with good explanations so that it is easy to change the code and adapt it to one's needs. This, of course, makes the "foreign language" portions of a phrase a bit longer than the phrase itself, but we think that really helps when working with the book.I also remember one famous Monty Python sketch in whi

Rewards Program