OReilly programming PHP 2nd edition apr 2006 ISBN 0596006810

1K 147 0
OReilly programming PHP 2nd edition apr 2006 ISBN 0596006810

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Programming PHP, 2nd Edition By Rasmus Lerdorf, Peter MacIntyre, Kevin Tatroe Publisher: O'Reilly Pub Date: April 2006 Print ISBN-10: 0-596-00681-0 Print ISBN-13: 978-0-59-600681-5 Pages: 540 Table of Contents | Index Programming PHP, Second Edition is the authoritative guide to PHP 5 and is filled with the unique knowledge of the creator of PHP (Rasmus Lerdorf) and other PHP experts When it comes to creating web sites, the PHP scripting language is truly a red-hot property In fact, PHP is currently used on more than 19 million web sites, surpassing Microsoft's ASP NET technology in popularity Programmers love its flexibility and speed; designers love its accessibility and convenience As the industry standard book on PHP, all of the essentials are covered in a clear and concise manner Language syntax and programming techniques are coupled with numerous examples that illustrate both correct usage and common idioms With style tips and practical programming advice, this book will help you become not just a PHP programmer, but also a good PHP programmer Programming PHP, Second Edition covers everything you need to know to create effective web applications with PHP Contents include: Detailed information on the basics of the PHP language, including data types, variables, operators, and flow control statements Chapters outlining the basics of functions, strings, arrays, and objects Coverage of common PHP web application techniques, such as form processing and validation, session tracking, and cookies Material on interacting with relational databases, such as MySQL and Oracle, using the database-independent PEAR DB library and the new PDO Library Chapters that show you how to generate dynamic images, create PDF files, and parse XML files with PHP Advanced topics, such as creating secure scripts, error handling, performance tuning, and writing your own C language extensions to PHP A handy quick reference to all the core functions in PHP and all the standard extensions that ship with PHP Praise for the first edition: "If you are just getting into the dynamic Web development world or you are considering migrating from another dynamic web product to PHP, Programming PHP is the book of choice to get you up, running and productive in a short time." Peter MacIntrye, eWeek "I think this is a great book for programmers who want to start developing dynamic web sites with PHP It gives a detailed overview of PHP, lots of valuable tips, and a good sense of PHP's strengths." David Dooling, Slashdot.org Programming PHP, 2nd Edition By Rasmus Lerdorf, Peter MacIntyre, Kevin Tatroe Publisher: O'Reilly Pub Date: April 2006 Print ISBN-10: 0-596-00681-0 Print ISBN-13: 978-0-59-600681-5 Pages: 540 Table of Contents | Index Programming PHP, Second Edition Foreword Preface Audience Assumptions This Book Makes Contents of This Book Conventions Used in This Book Using Code Examples Comments and Questions Safari® Enabled Acknowledgments Chapter 1 Introduction to PHP Section 1.1 What Does PHP Do? Section 1.2 A Brief History of PHP Section 1.3 Installing PHP Section 1.4 A Walk Through PHP Chapter 2 Language Basics Section 2.1 Lexical Structure Section 2.2 Data Types Section 2.3 Variables Section 2.4 Expressions and Operators Section 2.5 Flow-Control Statements Section 2.6 Including Code Section 2.7 Embedding PHP in Web Pages Chapter 3 Functions Section 3.1 Calling a Function Section 3.2 Defining a Function Section 3.3 Variable Scope Section 3.4 Function Parameters Section 3.5 Return Values Section 3.6 Variable Functions Section 3.7 Anonymous Functions Chapter 4 Strings Section 4.1 Quoting String Constants Section 4.2 Printing Strings Section 4.3 Accessing Individual Characters Section 4.4 Cleaning Strings Section 4.5 Encoding and Escaping Section 4.6 Comparing Strings Section 4.7 Manipulating and Searching Strings Section 4.8 Regular Expressions Section 4.9 POSIX-Style Regular Expressions Section 4.10 Perl-Compatible Regular Expressions Chapter 5 Arrays Section 5.1 Indexed Versus Associative Arrays Section 5.2 Identifying Elements of an Array Section 5.3 Storing Data in Arrays Section 5.4 Multidimensional Arrays Section 5.5 Extracting Multiple Values Section 5.6 Converting Between Arrays and Variables Section 5.7 Traversing Arrays Section 5.8 Sorting Section 5.9 Acting on Entire Arrays Section 5.10 Using Arrays Chapter 6 Objects Section 6.1 Terminology Section 6.2 Creating an Object Section 6.3 Accessing Properties and Methods Section 6.4 Declaring a Class Section 6.5 Introspection Section 6.6 Serialization Chapter 7 Web Techniques Section 7.1 HTTP Basics Section 7.2 Variables Section 7.3 Server Information Section 7.4 Processing Forms Section 7.5 Setting Response Headers Section 7.6 Maintaining State Section 7.7 SSL Chapter 8 Databases Section 8.1 Using PHP to Access a Database Section 8.2 Relational Databases and SQL Section 8.3 PEAR DB Basics Section 8.4 Advanced Database Techniques Section 8.5 Sample Application Chapter 9 Graphics Section 9.1 Embedding an Image in a Page Section 9.2 The GD Extension Section 9.3 Basic Graphics Concepts Section 9.4 Creating and Drawing Images Section 9.5 Images with Text Section 9.6 Dynamically Generated Buttons Section 9.7 Scaling Images Section 9.8 Color Handling Chapter 10 PDF Section 10.1 PDF Extensions Section 10.2 Documents and Pages Section 10.3 Text Chapter 11 XML Section 11.1 Lightning Guide to XML Section 11.2 Generating XML Section 11.3 Parsing XML Section 11.4 Parsing XML with DOM Section 11.5 Parsing XML with SimpleXML Section 11.6 Transforming XML with XSLT Section 11.7 Web Services Chapter 12 Security Section 12.1 Filter Input Section 12.2 Escape Output Section 12.3 Cross-Site Scripting Section 12.4 Session Fixation Section 12.5 File Uploads Section 12.6 File Access Section 12.7 PHP Code Section 12.8 Shell Commands Section 12.9 More Information Section 12.10 Security Recap Chapter 13 Application Techniques Section 13.1 Code Libraries Section 13.2 Templating Systems Section 13.3 Handling Output Section 13.4 Error Handling Section 13.5 Performance Tuning Chapter 14 Extending PHP Section 14.1 Architectural Overview Section 14.2 What You'll Need Section 14.3 Building Your First Extensions Section 14.4 The config.m4 File Section 14.5 Memory Management Section 14.6 The pval /zval Data Type Section 14.7 Parameter Handling Section 14.8 Returning Values Section 14.9 References Section 14.10 Global Variables Section 14.11 Creating Variables Section 14.12 Extension INI Entries Section 14.13 Resources Section 14.14 Where to Go from Here Chapter 15 PHP on Windows Section 15.1 Installing and Configuring PHP on Windows Section 15.2 Writing Portable Code for Windows and Unix Section 15.3 Interfacing with COM Section 15.4 Interacting with ODBC Data Sources Appendix A Function Reference Section A.1 PHP Functions by Category Section A.2 Alphabetical Listing of PHP Functions Appendix B Extension Overview Section B.1 Optional Extensions Listing About the Author Colophon Index Programming PHP, Second Edition by Rasmus Lerdorf, Kevin Tatroe, and Peter MacIntyre Copyright © 2006, 2002 O'Reilly Media, Inc All rights reserved Printed in the United States of America Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Editor: Tatiana Apandi and Allison Randal Production Editor: Matt Hutchinson Production Services: GEX, Inc Cover Designer: Ellie Volckhausen Interior Designer: David Futato Illustrators: Robert Romano, Jessamyn Read, and Lesley Borash Printing History: March 2002: First Edition April 2006: Second Edition Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc Programming PHP, the image of a cuckoo, and related trade dress are trademarks of O'Reilly Media, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and O'Reilly Media, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein ISBN: 0-596-00681-0 [M] Foreword Today, PHP is the most widely used programming language on the Web, with over 40 percent of all web applications written in PHP It is installed on over 22 million domain servers (source: Netcraft), as shown in Figure F-1 The number of developers using PHP has now reached over 2.5 million The community developing PHP is very impressive, with over 450 CVS committers who wrote a total of 1 million lines of code The PHP community is one of the most dynamic, with thousands of people sharing code, evangelizing about PHP, supporting each other, and creating many projects such as Wikipedia, Mambo, PHP-Nuke, FUDforum, SugarCRM, and Horde, just to mention a few Figure F-1 PHP development timeline with usage Its simplicity is what made PHP so successful Simplicity equals less code Developers and companies have been developing projects with PHP in a fraction of the time it would take another language There is an unacknowledged war that goes on every day in the world of programming It is a war between the humans and the computer scientists It is a war between those who want simple, sloppy, flexible, human ways to write code and those who want clean, crisp, clear, correct ways to write code It is the war between PHP and C++/Java Adam Bosworth Google The future of PHP looks very bright Leading platform vendors such as IBM, Oracle, MySQL, Intel, and, most recently, Red Hat have all endorsed it The new Collaboration Project initiated by Zend Technologies rallies many leading companies and community members around new open source initiatives aimed at taking PHP to the next level by creating an industrial-grade, de facto standard PHP web application development and deployment environment The Project's first two open initiatives are: Zend PHP Framework This is a web application framework that will accelerate and improve the development and deployment of missioncritical PHP web applications Support for the Eclipse Development platform Zend is joining the Eclipse Foundation as a Strategic Developer It will develop, in collaboration with partners, a storing data in arrays str_ireplace function str_pad function str_repeat function str_replace function str_rot13 function str_shuffle function str_split function str_word_count function strcasecmp function strchr function strcmp function strcoll function strcspn function 2nd strftime function strings Boolean values C-string encoding case, changing characters cleaning comparing approximate equality exact concatenation operator decomposing exploding imploding tokenizing entity-quoting HTML syntax characters entity-quoting special characters heredocs HTML tags, removing miscellaneous functions printing echo command print function print_r function printf function var_dump function query-strings, encoding searches masks position single-quoted SQL and, slashes substrings whitespace, removing strip_tags function 2nd stripcslashes function stripos function stripslashes function 2nd stristr function strlen function 2nd strnatcasecmp function strnatcmp function strncasecmp function strncmp function strpbrk function strpos function 2nd strrchr function strrev function strripos function strrpos function strspn function 2nd strstr function 2nd strtok function strtolower function 2nd strtotime function strtoupper function 2nd strtr function strval function subclasses subpatterns, regular expressions substr function 2nd substr_compare function substr_count function substr_replace function substrings subtraction operator (-) sum of an array superclasses suppressing errors switch statement Sybase extension symbol table memory management and reference count and symlink function syslog function system function System V Semaphore extension Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] tables, PDFs tags tan function tanh function templating systems tempnam function testing extensions text images and fonts TrueType fonts PDFs attributes coordinates footers headers text representation of images tidy extension time function time_nanosleep function tmpfile function tokenizing strings touch function trailing options, Perl-compatible regular expressions transactions, databases trigger_error function 2nd triggering errors trim function 2nd true color color indexes formats type juggling type specifiers, printf function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] uasort function ucfirst function ucwords function uksort function umask function Unicode data, XML uniqid function unlink function unpack function unparsed entities, XML 2nd unregister_tick_function function unserialize function 2nd unset function UPDATE statement (SQL) uploads forms and security browser-supplied filenames filling filesystem register_globals urldecode function 2nd urlencode function 2nd URLs decoding decomposing encoding User-Agent header user_error function usleep function usort function 2nd Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] validating forms values arrays multiple values ranges, assigning searches function return values passing parameters by returning from functions arrays objects simple types var_dump function 2nd var_export function variable functions variable interpolation double-quoted strings variable scope variables creating from arrays creating arrays from declaring function parameters global names, identifiers parameters references registration scope global 2nd local static static 2nd variable web Verisign Payflow Pro extension version_compare function vprintf function vsprintf function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] _ _wakeup function warnings, errors WDDX extension web services, XML and while statement whitespace statements and strings, removing from Windows PHP configuration PHP installation Word documents, COM wordwrap function Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] XML (Extemsible Markup Language) case folder character encoding clients documents ad hoc DTD Schema dynamic, RSS elements embedding PHP and entities external unparsed entity handlers generating parser creation parsing character data handler default handler DOM and element handlers entity handlers errors methods as handlers processing instructions sample application SimpleXML and processing instructions servers and Unicode data web services and well-formed documents XML Parser extension xml_get_error_code function xml_parse function xml_parser_create function xml_set_character_data_handler function xml_set_default_handler function xml_set_element_handler function xml_set_processing_instruction_handler function XSLT (Extensible Stylesheet Language Transformations) XXS (cross-site scripting), security and Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] YAZ extension YP/NIS extension Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z] zend_logo_guid function zend_version function zlib compression extension zval data type MAKE_STD_ZVAL( ) macro SEPARATE_ZVAL( ) macro zval_copy_ctor function zval_copy_ctor function ... "I think this is a great book for programmers who want to start developing dynamic web sites with PHP It gives a detailed overview of PHP, lots of valuable tips, and a good sense of PHP' s strengths." David Dooling, Slashdot.org Programming PHP, 2nd Edition By Rasmus Lerdorf, Peter MacIntyre, Kevin Tatroe... Publisher: O'Reilly Pub Date: April 2006 Print ISBN- 10: 0-596-00681-0 Print ISBN- 13: 978-0-59-600681-5 Pages: 540 Table of Contents | Index Programming PHP, Second Edition Foreword... March 2002: First Edition April 2006: Second Edition Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc Programming PHP, the image of a cuckoo, and related trade

Ngày đăng: 26/03/2019, 17:06

Mục lục

  • Programming PHP, 2nd Edition

  • Table of Contents

  • Programming PHP, Second Edition

  • Foreword

  • Preface

    • Audience

    • Assumptions This Book Makes

    • Contents of This Book

    • Conventions Used in This Book

    • Using Code Examples

    • Comments and Questions

    • Safari® Enabled

    • Acknowledgments

    • Chapter 1. Introduction to PHP

      • Section 1.1. What Does PHP Do?

      • Section 1.2. A Brief History of PHP

      • Section 1.3. Installing PHP

      • Section 1.4. A Walk Through PHP

      • Chapter 2. Language Basics

        • Section 2.1. Lexical Structure

        • Section 2.2. Data Types

        • Section 2.3. Variables

        • Section 2.4. Expressions and Operators

Tài liệu cùng người dùng

Tài liệu liên quan