PHP 5 in Practice

Купить бумажную книгу и читать

Купить бумажную книгу

По кнопке выше можно купить бумажные варианты этой книги и похожих книг на сайте интернет-магазина "Лабиринт".

Using the button above you can buy paper versions of this book and similar books on the website of the "Labyrinth" online store.

Реклама. ООО "ЛАБИРИНТ.РУ", ИНН: 7728644571, erid: LatgCADz8.

Автор:Elliott White, Jonathan D. Eisenhamer

Название:PHP 5 in Practice

Издательство:Sams; 1 edition

Год:2006

Формат:CHM

Размер:11.78 MB

Язык:Английский

Для сайта:

With the release of PHP 5 web developers need a guide to developing with PHP 5 to both learn its complex new features and more fully implement the long-standing features on which PHP's success is built. PHP 5 in Practice is a reference guide that provides developers with easy-to-use and easily extensible code to solve common PHP problems. It focuses on providing real code solutions to problems, allowing the reader to learn by seeing exactly what is happening behind the scenes to get your solution. Because a real-life situation will rarely match the book's example problems precisely, PHP 5 in Practice explains the solution well enough that you will understand it and can learn how to truly solve your own problem.

Содержание:

 

About the Author

Acknowledgments

We Want to Hear from You!

Reader Services

Introduction

Purpose, Scope, and Target of This Book

Web Support

Coding Standards Used

Comments and Whitespace

Part I: PHP Internals

Chapter 1. Strings

Section 1.1. Matching Patterns (Regular Expressions)

Section 1.2. Cleaning Up Whitespace

Section 1.3. Expanding and Compressing Tabs

Section 1.4. Converting Text Between Macintosh, UNIX, and PC Format

Section 1.5. Parsing CSV (Comma-Separated Values)

Section 1.6. Truncating Text to Fit Within a Specific Space

Section 1.7. Padding Arrays of Data to Display as Columns

Section 1.8. Checking the Spelling of a Word

Section 1.9. Matching Similar Strings

Section 1.10. Performing Proper Capitalization on Titles

Section 1.11. Generating Unique Identifiers

Section 1.12. Counting the Number of Times Certain Words Appear

Chapter 2. Numbers

Section 2.1. Retrieving a Number from a String

Section 2.2. Printing Proper Plural Text

Section 2.3. Converting Numbers into Roman Numerals

Section 2.4. Calculating Interest

Section 2.5. Simulating Dice

Section 2.6. Latitude/Longitude Calculations

Section 2.7. Metric/English Conversion

Section 2.8. Temperature Conversion

Section 2.9. Statistics Package Creation

Chapter 3. Time and Date

Section 3.1. Calculating the Difference Between Two Dates

Section 3.2. Determining Last Day of a Given Month

Section 3.3. Leap Year Calculation

Section 3.4. Handling Time Zones

Section 3.5. Handling Time Stamps Within Databases or in Files

Section 3.6. Determining Number of Business Days

Section 3.7. Generating a Calendar for a Given Month

Chapter 4. Variables

Section 4.1. Determining Whether a Variable Is Equal to Another

Section 4.2. Accessing a Variable Outside a Function, from Within it (Global Variables)

Section 4.3. Keeping a Persistent Value Within a Function (Static Variables)

Section 4.4. Having One Variable Refer to Another (References)

Section 4.5. Using a Variable to Hold the Name of Another Variable

Section 4.6. Declaring a Constant Instead of a Variable

Section 4.7. Coalescing a List of Values to Determine the First Non-False Value

Chapter 5. Arrays

Section 5.1. Superglobal Arrays and Their Usage

Section 5.2. Stack Implementation

Section 5.3. Queue Implementation

Section 5.4. Sorting with User-Defined Comparisons

Section 5.5. Sorting with Alternative Algorithms

Section 5.6. Recursive Handling of Multidimensional Arrays

Section 5.7. Performing Set Operations on Arrays

Section 5.8. Matrix Math Execution Using Arrays

Chapter 6. Functions

Section 6.1. Setting Optional Parameters

Section 6.2. Creating Recursive Functions

Section 6.3. Calling Functions Using a Function Name Stored in a Variable

Section 6.4. Dynamically Creating a Function (Lambda-Style)

Section 6.5. Using an Array of Functions for Processing

Section 6.6. Passing or Returning a Value by Reference

Section 6.7. Using an Arbitrary Number of Parameters

Section 6.8. Requiring a Parameter to Be a Certain Type

Chapter 7. Classes and Objects

Section 7.1. Automatically Loading Class Source Files

Section 7.2. Protecting Object Data (public/private/protected)

Section 7.3. Automatically Running Code On Creation or Destruction of an Object

Section 7.4. Accessing a Class's Members Without Instantiation

Section 7.5. Extending a Class Definition

Section 7.6. Creating an Abstract Class

Section 7.7. Using Object Interfaces

Section 7.8. Dynamic and Overloaded Variable Names

Section 7.9. Overloading Methods

Section 7.10. Linked List Implementation

Section 7.11. Binary Tree Implementation

Chapter 8. Files and Directories

Section 8.1. Generating a Full Directory Listing

Section 8.2. Natural Display of File Sizes

Section 8.3. Renaming All Files Within a Directory

Section 8.4. Search for Filenames Within a Directory Tree

Section 8.5. Handling Relative and Absolute File Paths

Section 8.6. Reading a File Via HTTP or FTP

Section 8.7. Watching the Contents of a File As It Grows (Simulating UNIX tail -f)

Section 8.8. Generating a Difference Report Between Two Files

Section 8.9. Locking a File for Exclusive Use

Section 8.10. Caching Remote Files Locally

Section 8.11. Compressing and Uncompressing Files

Section 8.12. Automatically Including Certain Files from the Parent Tree

Part II: Applications

Chapter 9. Web Page Creation/XHTML/CSS

Section 9.1. Creating a Multilayer Drop-Down Menu

Section 9.2. Highlighting What Section of a Website the User Is In

Section 9.3. Displaying Dynamic Progress Bars

Section 9.4. Simulating Graphical Charts with XHTML/CSS

Section 9.5. Pagination of Results on a Web Page

Section 9.6. Caching Web Page Output for Server Optimization

Section 9.7. Localizing a Web Page for Different Languages

Section 9.8. Using Ajax with PHP to Create an Interactive Web Page

Chapter 10. Web Form Handling

Section 10.1. Easily Obtaining Form Data

Section 10.2. Obtaining Multidimensional Arrays of Form Data

Section 10.3. Using GET and POST Form Data Together

Section 10.4. Accepting Uploaded Files

Section 10.5. Generating Select Statements

Section 10.6. Requiring Certain Fields to Be Filled Out

Section 10.7. Manipulating Text for Display on Bulletin Boards (BBCode)

Section 10.8. Accepting and Displaying User Data Giving Warnings for Links

Section 10.9. Preventing Multiple Form Submissions

Chapter 11. Data Validation and Standardization

Section 11.1. Phone Numbers

Section 11.2. ZIP Codes

Section 11.3. Social Security Numbers (SSNs)

Section 11.4. Numbers

Section 11.5. Credit Card Numbers

Section 11.6. Dates

Section 11.7. Email Accounts

Section 11.8. URLs

Chapter 12. Sessions and User Tracking

Section 12.1. Using Cookies to Remember Data

Section 12.2. Saving User Data with Sessions

Section 12.3. Customizing Display Settings for a User

Section 12.4. Creating a Library for Tracking a User Through Your Website

Section 12.5. Implementing a Simple Shopping Cart

Section 12.6. Passing Session Data Between Two Servers

Section 12.7. Parsing Specific Browser Information from Log Files

Chapter 13. Web Services and Other Protocols

Section 13.1. Submitting a POST HTTP Request with cURL

Section 13.2. Communicating with an LDAP Server

Section 13.3. Using Web Services Via SOAP

Section 13.4. Connecting to an FTP Server

Section 13.5. Creating a PHP-Based FTP Client

Section 13.6. Using Sockets to Connect to an Internet Server

Section 13.7. Creating Your Own Basic Web Server

Chapter 14. Relational Databases

Section 14.1. Communicating with MySQL

Section 14.2. Communicating with Oracle

Section 14.3. Communicating with PostgreSQL

Section 14.4. Communicating with Sybase

Section 14.5. Communicating with Microsoft SQL Server

Section 14.6. Communicating with SQLite

Section 14.7. Communicating with Databases Through ODBC

Section 14.8. Using an Abstraction Layer to Communicate with a Database (PDO)

Section 14.9. Implementing an SQLite Based Blog

Chapter 15. Other Data Storage Methods

Section 15.1. Creating and Reading CSV files

Section 15.2. Using Custom Text Files for Storage

Section 15.3. Accessing and Updating DBM-Style Databases

Section 15.4. Storing Data Via Serialize and Unserialize

Section 15.5. Automatically Creating and Updating PHP Include Files

Chapter 16. Email

Section 16.1. Sending Email (Text/HTML/Dual Format/Inline Images/Attachments)

Section 16.2. Determining Whether an Email Account Exists

Section 16.3. Creating a Mass Email Mailer

Section 16.4. Implementing Basic Mailing List Software

Section 16.5. Protecting Email Addresses from Spam Collectors

Section 16.6. Creating a Watchdog Process to Send Email If a Web Page Changes

Chapter 17. XML

Section 17.1. Parsing an XML File to Retrieve Data

Section 17.2. Performing Searches Through XML with XPath

Section 17.3. Validating an XML Document

Section 17.4. Transforming XML into XHTML with XSLT

Section 17.5. Creating an RSS File

Section 17.6. Creating an RSS Display Script for Websites

Chapter 18. Images

Section 18.1. Generating Composite Images with Text

Section 18.2. Drawing Tips and Tricks

Section 18.3. Using Transparent Backgrounds in Images

Section 18.4. Creating a Graph/Chart Library

Section 18.5. Automatically Creating a Photo Gallery from Digital Camera Files (Exif Data)

Chapter 19. Error Reporting and Debugging

Section 19.1. Defining a Custom Error Handler

Section 19.2. Using Exceptions to Handle Errors

Section 19.3. Timing the Execution of Your Script

Section 19.4. Using Shutdown Functions to Gracefully Handle Script Failures

Section 19.5. Generating Detailed Backtracing for Error Reporting

Chapter 20. User Authentication and Encryption

Section 20.1. Generating Random Passwords

Section 20.2. Using Encryption to Protect Data

Section 20.3. Simple CAPTCHA for Real User Detection

Section 20.4. Authenticating Users

Part III: Appendices

Appendix A. Migrating to PHP 5

Object Model

MySQL Module

CLI and CGI

Case Sensitivity of Classes, Methods, Functions

array_merge()

Functions That Return by Reference

Appendix B. SPL

Basic Interface

Creating Your Own Iterators

Extending Iterators and Chained Iterators

Getting Complicated

Recursive Iteration

Defining a Recursive Iteration Class

Appendix C. Common PHP Error Messages

Error Levels

Output Result: A Blank Page

Notice: Use of undefined constant asdf - assumed 'asdf'

Notice: Undefined variable: asdf

Notice: Undefined index: asdf

Parse error: syntax error, unexpected T_STRING Parse error: syntax error, unexpected T_VARIABLE Parse error: syntax error, unexpected T_IF and so on

Parse error: syntax error, unexpected $end

Parse error: syntax error, unexpected '=', expecting ';'

Fatal error: Maximum execution time of 60 seconds exceeded

Warning: Cannot modify header information - headers already sent

Warning: Wrong parameter count for foo()

Fatal error: Call to undefined function foo2()

Fatal Error: Cannot redeclare foo()

Index

Дата создания страницы: