Flylib.com
PHP Developers Cookbook (2nd Edition)
PHP Developers Cookbook (2nd Edition)
ISBN: 0672323257
EAN: 2147483647
Year: 2000
Pages: 351
Authors:
Sterling Hughes
,
Andrei Zmievski
BUY ON AMAZON
Main Page
Table of content
Copyright
Foreword
About the Authors
Acknowledgments
Tell Us What You Think
Introduction
Purpose
How to Use This Book
Chapter Summary
DB.php and Its Use in This Book
The History of PHP
Enter PHP 4
Improved Performance
Improved Object-Oriented Support
Improved Array-Handling Support
Integrated Sessions Support
Java Integration
Output Buffering Support
Many New Extensions
PEAR
Part I: Language Constructs and Techniques
Chapter 1. Manipulating Strings
1.0 Introduction
1.1 Dissecting Strings
1.2 Using the Ternary Operator
1.3 Swapping Variables
1.4 Converting ASII Codes into Characters
1.5 Splitting a String by Characters
1.6 Reversing Parts of a String
1.7 Converting the Case of a String
1.8 Removing Whitespace from a String
1.9 Escaping Special Characters in a String
1.10 Reading a Comma-Delimited Text File
1.11 Parsing a URL
1.12 Fuzzy Matching
1.13 Creating a Unique Identifier
1.14 Encrypting a String
1.15 Converting Between Cyrillic Character Sets
Chapter 2. Working with Numbers, Dates, and Times
2.0 Introduction
2.1 Checking Whether a Variable Is a Valid Number
2.2 Working on a Series of Numbers
2.3 Working with Numbers That Are Not Float or Integer
2.4 Rounding Arbitrary-Precision Numbers
2.5 Converting Numbers Between Different Bases
2.6 Finding the Log of a Number
2.7 Finding the Binary Representation of a Number
2.8 Converting Between Arabic and Roman Numerals
2.9 Validating Credit Card Numbers
2.10 Formatting Numbers
2.11 Converting Between Radians and Degrees
2.12 Calculating Cosines, Sines, and Tangents
2.13 Generating Random Numbers
2.14 Generating Unique Random Numbers
2.15 Weighting Random Numbers
2.16 Loading Today s Date into an Array
2.17 Checking the Validity of a Date
2.18 Determining Date Intervals
2.19 Finding the Date and Time for Different Locales
2.20 Formatting Timestamps
2.21 Parsing Dates and Times from Strings
2.22 Performing Benchmarks
2.23 Halting Program Execution
Chapter 3. Using Arrays
3.0 Introduction
3.1 Declaring an Array
3.2 Printing Out an Array
3.3 Eliminating Duplicate Elements
3.4 Enlarging or Shrinking an Array
3.5 Merging Arrays
3.6 Iteratively Processing Elements in an Array
3.7 Accessing the Current Element in an Array
3.8 Accessing Different Areas of an Array
3.9 Searching an Array
3.10 Searching for the Different Elements in Two Arrays
3.11 Randomizing the Elements of an Array
3.12 Determining the Union, Intersection, or Difference Between Two Arrays
3.13 Sorting an Array
3.14 Sorting Sensibly
3.15 Reversing Order
3.16 Perl-Based Array Manipulation Features
Chapter 4. PHP s Built-in Arrays and Constants
4.1 Working with File Constants
4.2 PHP s OS and Version Constants
4.3 Setting Breakpoints by Using PHP s Error Constants
4.4 Defining Your Own PHP Constants
4.5 Working with PHP Globals
4.6 Accessing Data Through PHP s Built-in Arrays
Chapter 5. Matching Data with Regular Expressions
5.0 Introduction
Regular Expression Basics
5.1 Assigning the Results of a Pattern Replacement
5.2 Using Perl-Compatible Regular Expressions in PHP
5.3 Incompatibilities Between the PCRE Library and Perl Regular Expressions
5.4 Matching over Multiple Lines
5.5 Finding a Specific Occurrence of a Match
5.6 Working with Delimited Records
5.7 Extracting Specific Lines
5.8 Checking Characters
5.9 Validating Web Data
5.10 Validating an E-mail Address
5.11 Checking the Syntax of a Regular Expression
5.12 Checking for Duplicate Words
5.13 Abbreviating Input
Chapter 6. Handling Files
6.0 Introduction
6.1 Checking Whether a File Exists
6.2 Checking File Permissions
6.3 Creating a Temporary File
6.4 Storing a File into Your Program
6.5 Opening a File
6.6 Handling Binary Data Safely
6.7 Flushing the Cache
6.8 Locking Files
6.9 Getting the Free Space Available on a Specified Drive
6.10 Displaying a Textfile to the User
6.11 Manipulating Standard IO Streams
6.12 Reading a File Line-by-Line
6.13 Working with a File Word-by-Word
6.14 Processing a File in Reverse
6.15 Parsing a File with Pattern Separators
6.16 Changing a Specific Record
6.17 Accessing Fixed-Length Records
6.18 Extracting a Single Line from a File
6.19 Truncating a File
6.20 Counting the Number of Lines in a File
6.21 Extracting a Random Line from a File
6.22 Randomizing Lines and Words
6.23 Creating Configuration Files
Chapter 7. Working with Files in Directories
7.0 Introduction
7.1 Working with Timestamps
7.2 Removing a File
7.3 Copying or Moving a File
7.4 Keeping Track of Filenames
7.5 Parsing the Parts of a Filename
7.6 Loading All Files in a Directory into an Array
7.7 Searching a Filesystem
7.8 Processing a Directory File-by-File
7.9 Recursively Deleting a Directory
7.10 Creating a Search Engine
Chapter 8. Functions
8.0 Introduction
8.1 Passing a Default Value to a Function
8.2 Accessing Variables Outside a Function
8.3 Returning Values from a Function
8.4 Passing Arguments by Reference
8.5 Retaining a Variable s Value Between Function Calls
8.6 Returning More Than One Value from a Function
8.7 Declaring Functions Dynamically
8.8 Dynamically Creating Anonymous Functions
8.9 Calling Functions Indirectly
8.10 Fetching an Arbitrary Number of Parameters
Chapter 9. Classes
9.0 Introduction
9.1 Creating a Class
9.2 Accessing Variables from Within a Class
9.3 Inheritance
9.4 Making Variables or Functions Public and Private
9.5 Creating a Constructor
9.6 Returning a Different Object from a Constructor
9.7 Creating a Class Destructor
9.8 Using Functions in a Class Without Initializing an Object
9.9 Indirectly Accessing a Method of the Parent Class
9.10 Returning an Error Object on Failure
Chapter 10. Maintaining Sessions with PHP
10.0 Introduction
10.1 Creating a Session Variable with PHP
10.2 Saving Sessions Using a Database
10.3 Setting the Session Name
10.4 Setting and Getting Cookie Parameters
10.5 Unregistering a Variable in a Session
10.6 Deleting All the Session Variables
10.7 Using Objects As Session Variables
10.8 Encode That Data
10.9 Creating a Shopping Cart Using Sessions and PHP
10.10 Serialization
10.11 WDDX Serialization
10.12 WDDX Deserialization
Chapter 11. Interacting with Web Pages and Servers
11.0 Introduction
11.1 Fetching a Web Page
11.2 Performing an SSL Transaction
11.3 Performing an HTTP POST Request
11.4 Performing an HTTP File Upload
11.5 Sending Cookies with Your Request
11.6 Excluding or Including the Header from a cURL Transfer
11.7 Connecting Through a Proxy Server
11.8 Getting Information Regarding a cURL Transfer
11.9 Interacting with Frames
11.10 Extracting All the URLs from a Web Page
11.11 Finding Stale and Fresh Links
11.12 Getting New Links from a Web Page
11.13 Mirroring a Web Page
11.14 Parsing and Formatting a Log File
Part II: Databases
Chapter 12. Creating a Database-Independent API with PHP
12.0 Introduction
12.1 The Glue
12.2 The MySQL Module
12.3 The mSQL Module
12.4 The Oracle Module
12.5 The MSSQL Module
12.6 The ODBC Module
12.7 The PostgreSQL Module
12.8 The InterBase Module
12.9 The Sybase Module
Part III: Going Outside PHP
Chapter 13. Interfacing with Other Programs and Languages
13.0 Introduction
13.1 Capturing the Output of Another Program
13.2 Printing the Output of a Program
13.3 Opening a Pipe to Another Program
13.4 Working with Sockets
13.5 Working with COM Objects
13.6 Accessing Predefined Java Methods and Classes
13.7 Accessing Your Own Custom Java Methods and Classes
Chapter 14. Communicating with Sockets
14.0 Introduction
14.1 A TCP Client
14.2 A TCP Server
14.3 Reading and Writing to Sockets
14.4 A UDP Client
14.5 A UDP Server
14.6 UNIX Domain Sockets
14.7 Handling Multiple IP Addresses
14.8 Nonblocking Sockets
14.9 Reading and Writing IO Vectors
14.10 Controlling Data Transfer Timeout
14.11 Getting Socket Status
Chapter 15. Handling E-mail
15.0 Introduction
15.1 Opening an IMAP Mailbox
15.2 Checking Whether an IMAP Stream Is Still Active
15.3 Converting Messages to a Readable Format
15.4 Sending E-mail
15.5 Sending Attachments with PHP
15.6 Sending Binary Attachments
15.7 Sending HTML E-mail
15.8 Getting the Size of a Message
15.9 Parsing Mail Headers
Chapter 16. Working with SNMP Objects
16.0 Introduction
16.1 Setting an SNMP Object
16.2 Getting an SNMP Object
16.3 Fetching All SNMP Objects into an Array
Chapter 17. LDAP
17.0 Introduction
17.1 Adding an Entry to an LDAP Server
17.2 Removing an Entry from an LDAP Server
17.3 Executing a Query and Getting the Results
17.4 Freeing an LDAP Result Set
17.5 Performing a Tree Search
17.6 Sorting Search Results
Part IV: Generating Other Languages
Chapter 18. Creating and Managing Images
18.1 Creating an Image with GD
18.2 Opening a Preexisting Image
18.3 Getting the Size of an Image
18.4 Adding Text to Images
18.5 Getting the Color of a Certain Part of an Image
18.6 Getting the Total Number of Colors in an Image
18.7 Making a GIFPNG Transparent
18.8 Copy One Part of an Image to Another
18.9 Drawing Rectangles
18.10 Drawing Polygons
18.11 Drawing an Arc
18.12 Making an Image Interlaced
18.13 Dynamic Buttons
18.14 Using TrueType Fonts
Chapter 19. HTML
19.0 Introduction
19.1 Stripping HTML Tags
19.2 Converting ASCII to HTML
19.3 Generating select Lists
19.4 Generating JavaScript Rollovers
19.5 Creating HTML Templates
Chapter 20. XML
20.0 Introduction
20.1 Error Handling
20.2 Parsing a Simple XML Document
20.3 Parsing an XML Document into an Array
20.4 Mapping XML Tags
20.5 Setting Up an External Reference Entity Handler
20.6 Searching XML
20.7 Saving Memory
20.8 Setting and Getting Options
20.9 Parsing Using the DOM-XML Functions
20.10 Building an XML Document
20.11 Transforming XML with an XSL Template
20.12 Filtering All Output Through an XSL File
Part V: The Zend API
Chapter 21. Zend API
21.0 Introduction
21.1 Getting Arguments
21.2 Modifying Function Arguments
21.3 Returning Strings or Numbers from a Function
21.4 Returning Arrays and Objects from Functions
21.5 Adding a Function to PHP
21.6 Creating Resource Identifiers
21.7 Fetching Resource Identifiers
21.8 Looping Through Arrays
21.9 Creating a PHP Module
21.10 Adding Your File to the PHP Installation
Appendix A. PHP Installation
Appendix B. Troubleshooting with PHP
Common Errors and What They Mean
Techniques to Cut Down on Errors and Bugs
Appendix C. PHP Online Resources
The Official PHP Web Site
The Zend Web Site
PHPBuilder
PHPWizard.net
The PHP Class Repository
Weberdev
DevShed
Appendix D. Migrating to PHP 4
Static Variable and Default Argument Initializers Accept Only Scalar Values
The Scopes of break and continue Are Local to That of an Included File, or an eval d String
A return Statement from a require d File Does Not Work
Unset Is Now a Statement, Not a Function
Is Not Supported in Strings
Index
Index SYMBOL
Index A
Index B
Index C
Index D
Index E
Index F
Index G
Index H
Index I
Index J
Index L
Index M
Index N
Index O
Index P
Index Q
Index R
Index S
Index T
Index U
Index V
Index W
Index X
PHP Developers Cookbook (2nd Edition)
ISBN: 0672323257
EAN: 2147483647
Year: 2000
Pages: 351
Authors:
Sterling Hughes
,
Andrei Zmievski
BUY ON AMAZON
CompTIA Project+ Study Guide: Exam PK0-003
IT Project Management Overview
Schedule Planning
Cost Planning
Other Planning Processes
Comprehensive Project Plan
Inside Network Security Assessment: Guarding Your IT Infrastructure
Security and the Employee (Social Engineering)
Introducing the Assessment Process
Putting Together a Toolkit
Building the Final Report
Vulnerability Management
Cisco IOS in a Nutshell (In a Nutshell (OReilly))
Ethernet, Fast Ethernet, and Gigabit Ethernet Interfaces
Types of Access Lists
IP Routing Topics
OSPF
Multicast Routing
MySQL Clustering
RAM Usage
Backup and Recovery
Physical Factors
MySQL Cluster Errors
Web Farm/MySQL Farm
Sap Bw: a Step By Step Guide for Bw 2.0
Creating InfoObject Catalogs
Summary
Creating an Authorization Profile Using Profile Generator
Summary
Appendix D. Bibliography
Extending and Embedding PHP
The PHP Life Cycle
The Other refcounter
Summary
Properties
Building and Compiling a Host Application
flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net
Privacy policy
This website uses cookies. Click
here
to find out more.
Accept cookies