PHP CookBook Free Open Book

PHP CookBook

Previous Section Next Section

What Is in This Book

We don't expect that you'll sit down and read this book from cover to cover. (although we'll be happy if you do!). PHP programmers are constantly faced with a wide variety of challenges on a wide range of subjects. Turn to the PHP Cookbook when you encounter a problem you need to solve. Each recipe is a self-contained explanation that gives you a head start towards finishing your task. When a recipe refers to topics outside its scope, it contains pointers to related recipes and other online and offline resources.

If you choose to read an entire chapter at once, that's okay. The recipes generally flow from easy to hard, with example programs that "put it all together" at the end of many chapters. The chapter introduction provides an overview of the material covered in the chapter, including relevant background material, and points out a few highlighted recipes of special interest.

The book begins with four chapters about basic data types. Chapter 1 covers details like processing substrings, manipulating case, taking strings apart into smaller pieces, and parsing comma-separated data. Chapter 2 explains operations with floating-point numbers, random numbers, converting between bases, and number formatting. Chapter 3 shows you how to manipulate dates and times, format them, handle time zones and daylight saving time, and find time to microsecond precision. Chapter 4 covers array operations like iterating, merging, reversing, sorting, and extracting particular elements.

Next are three chapters that discuss program building blocks. Chapter 5 covers notable features of PHP's variable handling, like default values, static variables, and producing string representations of complex data types. The recipes in Chapter 6 deal with using functions in PHP: processing arguments, passing and returning variables by reference, creating functions at runtime, and scoping variables. Chapter 7 covers PHP's object-oriented capabilities, with recipes on using overloading and polymorphism, defining constructors, and cloning objects.

The heart of the book is five chapters devoted to topics that are central to web programming. Chapter 8 covers cookies, headers, authentication, configuration variables, and other fundamentals of web applications. Chapter 9 covers processing and validating form input, displaying multi-page forms, showing forms with error messages, and escaping special characters in user data. Chapter 10 explains the differences between text-file, DBM, and SQL databases and, using the PEAR DB database abstraction layer, shows how to assign unique ID values, retrieve rows, change data, escape quotes, and log debugging information. Chapter 11 focuses on retrieving URLs and processing HTML but also touches on using templates and parsing server access logs. Chapter 12 covers XML and related formats, including the DOM, SAX, XSLT, XML-RPL, and SOAP.

The next section of the book is a series of chapters on other features and extensions of PHP that provide a lot of useful functionality. These are recipes that help you build applications that are more robust, secure, user-friendly, and efficient. Chapter 13 covers regular expressions, including matching a valid email address, capturing text inside of HTML tags, and using greedy or non-greedy matching. Chapter 14 discusses encryption, including generating and storing passwords, sharing encrypted data with others, storing encrypted data in a file or database, and using SSL. Chapter 15 shows you how to create graphics, with recipes on drawing text, lines, polygons, and curves. Chapter 16 helps you make your applications globally friendly and includes recipes on using locales and localizing text, dates and times, currency values, and images. Chapter 17 discusses network-related tasks, like reading and sending email messages and newsgroup posts, using FTP and LDAP, and doing DNS and Whois lookups.

Chapter 18 and Chapter 19 cover the filesystem. Chapter 18 focuses on files: opening and closing them, using temporary files, locking file, sending compressed files, and processing the contents of files. Chapter 19 deals with directories and file metadata, with recipes on changing file permissions and ownership, moving or deleting a file, and processing all files in a directory.

Last, there are two chapters on topics that extend the reach of what PHP can do. Chapter 20 covers using PHP outside of web programming. Its recipes cover command-line topics like parsing program arguments and reading passwords, as well as topics related to building client-side GUI applications with PHP-GTK like displaying widgets, responding to user actions, and displaying menus. Chapter 21 covers PEAR, the PHP Extension and Application Repository. PEAR is a collection of PHP code that provides various functions and extensions to PHP. We use PEAR modules throughout the book and Chapter 21 shows you how to install and upgrade them.

    Previous Section Next Section
    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][Z]


         Main Menu
    Main Page
    Table of content
    Copyright
    Preface
    Who This Book Is For
    What Is in This Book
    Other Resources
    Conventions Used in This Book
    Comments and Questions
    Acknowledgments
    Chapter 1. Strings
    Chapter 2. Numbers
    Chapter 3. Dates and Times
    Chapter 4. Arrays
    Chapter 5. Variables
    Chapter 6. Functions
    Chapter 7. Classes and Objects
    Chapter 8. Web Basics
    Chapter 9. Forms
    Chapter 10. Database Access
    Chapter 11. Web Automation
    Chapter 12. XML
    Chapter 13. Regular Expressions
    Chapter 14. Encryption and Security
    Chapter 15. Graphics
    Chapter 16. Internationalization and Localization
    Chapter 17. Internet Services
    Chapter 18. Files
    Chapter 19. Directories
    Chapter 20. Client-Side PHP
    Chapter 21. PEAR
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele