By David Sklar, Adam Trachtenberg
Publisher Pub Date ISBN Pages
: O'Reilly : November 2002 : 1-56592-681-1 : 632
The PHP Cookbook is a collection of problems, solutions, and practical examples for PHP programmers. The book contains a unique and extensive collection of best practices for everyday PHP programming dilemmas. It contains over 250 recipes, ranging from simple tasks to entire programs that demonstrate complex tasks, such as printing HTML tables and generating bar charts -- a treasure trove of useful code for PHP programmers, from novices to advanced practitioners.
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 Section 1.1. Introduction Recipe 1.2. Accessing Substrings Recipe 1.3. Replacing Substrings Recipe 1.4. Processing a String One Character at a Time Recipe 1.5. Reversing a String by Word or Character Recipe 1.6. Expanding and Compressing Tabs Recipe 1.7. Controlling Case Recipe 1.8. Interpolating Functions and Expressions Within Strings Recipe 1.9. Trimming Blanks from a String Recipe 1.10. Parsing Comma-Separated Data Recipe 1.11. Parsing Fixed-Width Delimited Data Recipe 1.12. Taking Strings Apart Recipe 1.13. Wrapping Text at a Certain Line Length Recipe 1.14. Storing Binary Data in Strings
Chapter 2. Numbers Section 2.1. Introduction Recipe 2.2. Checking Whether a String Contains a Valid Number Recipe 2.3. Comparing Floating-Point Numbers Recipe 2.4. Rounding Floating-Point Numbers Recipe 2.5. Operating on a Series of Integers Recipe 2.6. Generating Random Numbers Within a Range Recipe 2.7. Generating Biased Random Numbers Recipe 2.8. Taking Logarithms Recipe 2.9. Calculating Exponents Recipe 2.10. Formatting Numbers Recipe 2.11. Printing Correct Plurals Recipe 2.12. Calculating Trigonometric Functions Recipe 2.13. Doing Trigonometry in Degrees, not Radians Recipe 2.14. Handling Very Large or Very