Synopses & Reviews
Programming PHP, 2nd 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 websites, the PHP scripting language is truly a red-hot property. In fact, PHP is currently used on more than 19 million websites, 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 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 youare 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 websites 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
Synopsis
PHP is a simple yet powerful open-source scripting language for creating dynamic Web content. PHP is used by both programmers, who appreciate its flexibility and speed, and Web designers, who value its accessibility and convenience. "Programming PHP" is an authoritative guide to the latest version of the language.
About the Author
Rasmus Lerdorf started the PHP Project back in 1995 and has been actively involved in PHP development ever since. Also involved in a number of other open source projects, Rasmus is a longtime Apache contributor and foundation member. He is the author of the first edition of the PHP Pocket Reference, and the co-author of the first edition of Programming PHP.
Kevin Tatroe has been a Macintosh and Unix programmer for ten years. He is an experienced PHP developer, knowledgeable in the changes coming with PHP 5. He is also co-author of the first edition of Programming PHP.
Peter MacIntyre lives and works in Charlottetown, Prince Edward Island, Canada. He has over 16 years of experience in the information technology industry, primarily in the area of software development.Peter's technical skill set includes several client/server tools and relational database systems such as PHP, PowerBuilder, Visual Basic, Active Server Pages, and CA-Visual Objects.Peter is certified by ZEND Corporation on PHP 4.x and has contributed writing material for Using Visual Objects (Que Corp.), Using PowerBuilder 5 (Que Corp.), ASP.NET Bible (Wiley Pub.), and Web Warrior Survey on Web Development Languages (Course Technology).Peter is also currently a contributing editor and author to the on-line and in-print magazine called php|architect (www.phparch.com). He has also spoken several times at North American and International computer conferences including CA-World in New Orleans, USA; CA-TechniCon in Cologne, Germany; and CA-Expo in Melbourne, Australia.
Table of Contents
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; 1.1 What Does PHP Do?; 1.2 A Brief History of PHP; 1.3 Installing PHP; 1.4 A Walk Through PHP; Chapter 2: Language Basics; 2.1 Lexical Structure; 2.2 Data Types; 2.3 Variables; 2.4 Expressions and Operators; 2.5 Flow-Control Statements; 2.6 Including Code; 2.7 Embedding PHP in Web Pages; Chapter 3: Functions; 3.1 Calling a Function; 3.2 Defining a Function; 3.3 Variable Scope; 3.4 Function Parameters; 3.5 Return Values; 3.6 Variable Functions; 3.7 Anonymous Functions; Chapter 4: Strings; 4.1 Quoting String Constants; 4.2 Printing Strings; 4.3 Accessing Individual Characters; 4.4 Cleaning Strings; 4.5 Encoding and Escaping; 4.6 Comparing Strings; 4.7 Manipulating and Searching Strings; 4.8 Regular Expressions; 4.9 POSIX-Style Regular Expressions; 4.10 Perl-Compatible Regular Expressions; Chapter 5: Arrays; 5.1 Indexed Versus Associative Arrays; 5.2 Identifying Elements of an Array; 5.3 Storing Data in Arrays; 5.4 Multidimensional Arrays; 5.5 Extracting Multiple Values; 5.6 Converting Between Arrays and Variables; 5.7 Traversing Arrays; 5.8 Sorting; 5.9 Acting on Entire Arrays; 5.10 Using Arrays; Chapter 6: Objects; 6.1 Terminology; 6.2 Creating an Object; 6.3 Accessing Properties and Methods; 6.4 Declaring a Class; 6.5 Introspection; 6.6 Serialization; Chapter 7: Web Techniques; 7.1 HTTP Basics; 7.2 Variables; 7.3 Server Information; 7.4 Processing Forms; 7.5 Setting Response Headers; 7.6 Maintaining State; 7.7 SSL; Chapter 8: Databases; 8.1 Using PHP to Access a Database; 8.2 Relational Databases and SQL; 8.3 PEAR DBPEAR DB Basics; 8.4 Advanced Database Techniques; 8.5 Sample Application; Chapter 9: Graphics; 9.1 Embedding an Image in a Page; 9.2 The GDGD Extension; 9.3 Basic Graphics Concepts; 9.4 Creating and Drawing Images; 9.5 Images with Text; 9.6 Dynamically Generated Buttons; 9.7 Scaling Images; 9.8 Color Handling; Chapter 10: PDF; 10.1 PDF Extensions; 10.2 Documents and Pages; 10.3 Text; Chapter 11: XML; 11.1 Lightning Guide to XML; 11.2 Generating XML; 11.3 Parsing XML; 11.4 Parsing XML with DOM; 11.5 Parsing XML with SimpleXML; 11.6 Transforming XML with XSLT; 11.7 Web Services; Chapter 12: Security; 12.1 Filter Input; 12.2 Escape Output; 12.3 Cross-Site Scripting; 12.4 Session Fixation; 12.5 File Uploads; 12.6 File Access; 12.7 PHP Code; 12.8 Shell Commands; 12.9 More Information; 12.10 Security Recap; Chapter 13: Application Techniques; 13.1 Code Libraries; 13.2 Templating Systems; 13.3 Handling Output; 13.4 Error Handling; 13.5 Performance Tuning; Chapter 14: Extending PHP; 14.1 Architectural Overview; 14.2 What You'll Need; 14.3 Building Your First Extensions; 14.4 The config.m4 File; 14.5 Memory Management; 14.6 The pvaldata typespval /zvaldata typeszval Data Type; 14.7 Parameter Handling; 14.8 Returning Values; 14.9 References; 14.10 Global Variables; 14.11 Creating Variables; 14.12 Extension INI Entries; 14.13 Resources; 14.14 Where to Go from Here; Chapter 15: PHP on Windows; 15.1 Installing and Configuring PHP on Windows; 15.2 Writing Portable Code for Windows and Unix; 15.3 Interfacing with COM; 15.4 Interacting with ODBC Data Sources; Appendix A: Function Reference; A.1 PHP Functions by Category; A.2 Alphabetical Listing of PHP Functions; Appendix B: Extension Overview; B.1 Optional Extensions Listing; Colophon;