Oreilly Php Cookbook
معرفی کتاب «Oreilly Php Cookbook» نوشتهٔ Sklar, David, Trachtenberg, Adam، منتشرشده توسط نشر O'Reilly Media در سال 2003. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Oreilly Php Cookbook» در دستهٔ بدون دستهبندی قرار دارد.
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. For Every Problem Addressed In The Book, There's A Worked-out Solution Or Recipe--a Short, Focused Piece Of Code You Can Insert Directly Into Your Application. However, This Book Offers More Than Cut-and-paste Code. You Also Get Explanations Of How And Why The Code Works, So You Can Learn To Adapt The Problem-solving Techniques To Similar Situations. The Recipes In The Php Cookbook Range From Simple Tasks, Such As Sending A Database Query And Fetching Urls, To Entire Programs That Demonstrate Complex Tasks, Such As Printing Html Tables And Generating Bar Charts. This Book Contains An Impressive Collection Of Useful Code For Php Programmers, From Novices To Advanced Practitioners. Instead Of Poking Around Mailing Lists, Online Documentation, And Other Sources, You Can Rely On The Php Cookbook To Provide Quick Solutions To Common Problems, So You Can Spend Your Time On Those Out-of-the-ordinary Problems Specific To Your Application. 1. Strings 1 -- 1.1 Accessing Substrings 3 -- 1.2 Replacing Substrings 5 -- 1.3 Processing A String One Character At A Time 6 -- 1.4 Reversing A String By Word Or Character 7 -- 1.5 Expanding And Compressing Tabs 8 -- 1.6 Controlling Case 10 -- 1.7 Interpolating Functions And Expressions Within Strings 12 -- 1.8 Trimming Blanks From A String 13 -- 1.9 Parsing Comma-separated Data 14 -- 1.10 Parsing Fixed-width Delimited Data 15 -- 1.11 Taking Strings Apart 17 -- 1.12 Wrapping Text At A Certain Line Length 20 -- 1.13 Storing Binary Data In Strings 21 -- 2. Numbers 24 -- 2.1 Checking Whether A String Contains A Valid Number 25 -- 2.2 Comparing Floating-point Numbers 26 -- 2.3 Rounding Floating-point Numbers 27 -- 2.4 Operating On A Series Of Integers 28 -- 2.5 Generating Random Numbers Within A Range 29 -- 2.6 Generating Biased Random Numbers 31 -- 2.7 Taking Logarithms 32 -- 2.8 Calculating Exponents 32 -- 2.9 Formatting Numbers 33 -- 2.10 Printing Correct Plurals 34 -- 2.11 Calculating Trigonometric Functions 36 -- 2.12 Doing Trigonometry In Degrees, Not Radians 37 -- 2.13 Handling Very Large Or Very Small Numbers 37 -- 2.14 Converting Between Bases 39 -- 2.15 Calculating Using Numbers In Bases Other Than Decimal 40 -- 3. Dates And Times 42 -- 3.1 Finding The Current Date And Time 43 -- 3.2 Converting Time And Date Parts To An Epoch Timestamp 46 -- 3.3 Converting An Epoch Timestamp To Time And Date Parts 47 -- 3.4 Printing A Date Or Time In A Specified Format 48 -- 3.5 Finding The Difference Of Two Dates 52 -- 3.6 Finding The Difference Of Two Dates With Julian Days 54 -- 3.7 Finding The Day In A Week, Month, Year, Or The Week Number In A Year 55 -- 3.8 Validating A Date 57 -- 3.9 Parsing Dates And Times From Strings 59 -- 3.10 Adding To Or Subtracting From A Date 61 -- 3.11 Calculating Time With Time Zones 62 -- 3.12 Accounting For Daylight Saving Time 67 -- 3.13 Generating A High-precision Time 68 -- 3.14 Generating Time Ranges 69 -- 3.15 Using Non-gregorian Calendars 70 -- 3.16 Program: Calendar 71 -- 4. Arrays 75 -- 4.1 Specifying An Array Not Beginning At Element 0 78 -- 4.2 Storing Multiple Elements Per Key In An Array 79 -- 4.3 Initializing An Array To A Range Of Integers 80 -- 4.4 Iterating Through An Array 81 -- 4.5 Deleting Elements From An Array 83 -- 4.6 Changing Array Size 85 -- 4.7 Appending One Array To Another 87 -- 4.8 Turning An Array Into A String 89 -- 4.9 Printing An Array With Commas 91 -- 4.10 Checking If A Key Is In An Array 92 -- 4.11 Checking If An Element Is In An Array 92 -- 4.12 Finding The Position Of An Element In An Array 94 -- 4.13 Finding Elements That Pass A Certain Test 95 -- 4.14 Finding The Largest Or Smallest Valued Element In An Array 96 -- 4.15 Reversing An Array 97 -- 4.16 Sorting An Array 98 -- 4.17 Sorting An Array By A Computable Field 99 -- 4.18 Sorting Multiple Arrays 101 -- 4.19 Sorting An Array Using A Method Instead Of A Function 103 -- 4.20 Randomizing An Array 104 -- 4.21 Shuffling A Deck Of Cards 105 -- 4.22 Removing Duplicate Elements From An Array 106 -- 4.23 Finding The Union, Intersection, Or Difference Of Two Arrays 107 -- 4.24 Finding All Element Combinations Of An Array 109 -- 4.25 Finding All Permutations Of An Array 111 -- 4.26 Program: Printing An Array In A Horizontally Columned Html Table 114 -- 5. Variables 117 -- 5.1 Avoiding == Versus = Confusion 118 -- 5.2 Establishing A Default Value 119 -- 5.3 Exchanging Values Without Using Temporary Variables 120 -- 5.4 Creating A Dynamic Variable Name 120 -- 5.5 Using Static Variables 122 -- 5.6 Sharing Variables Between Processes 123 -- 5.7 Encapsulating Complex Data Types As A String 125 -- 5.8 Dumping Variable Contents As Strings 127 -- 6. Functions 131 -- 6.1 Accessing Function Parameters 132 -- 6.2 Setting Default Values For Function Parameters 133 -- 6.3 Passing Values By Reference 135 -- 6.4 Using Named Parameters 136 -- 6.5 Creating Functions That Take A Variable Number Of Arguments 137 -- 6.6 Returning Values By Reference 140 -- 6.7 Returning More Than One Value 140 -- 6.8 Skipping Selected Return Values 142 -- 6.9 Returning Failure 143 -- 6.10 Calling Variable Functions 144 -- 6.11 Accessing A Global Variable Inside A Function 145 -- 6.12 Creating Dynamic Functions 147 -- 7. Classes And Objects 148 -- 7.1 Instantiating Objects 152 -- 7.2 Defining Object Constructors 153 -- 7.3 Destroying An Object 154 -- 7.4 Cloning Objects 154 -- 7.5 Assigning Object References 155 -- 7.6 Calling Methods On An Object Returned By Another Method 156 -- 7.7 Accessing Overridden Methods 157 -- 7.8 Using Property Overloading 159 -- 7.9 Using Method Polymorphism 160 -- 7.10 Finding The Methods And Properties Of An Object 163 -- 7.11 Adding Properties To A Base Object 164 -- 7.12 Creating A Class Dynamically 165 -- 7.13 Instantiating An Object Dynamically 166 -- 8. Web Basics 168 -- 8.1 Setting Cookies 169 -- 8.2 Reading Cookie Values 171 -- 8.3 Deleting Cookies 171 -- 8.4 Redirecting To A Different Location 172 -- 8.5 Using Session Tracking 173 -- 8.6 Storing Sessions In A Database 175 -- 8.7 Detecting Different Browsers 179 -- 8.8 Building A Get Query String 180 -- 8.9 Using Http Basic Authentication 182 -- 8.10 Using Cookie Authentication 184 -- 8.11 Flushing Output To The Browser 187 -- 8.12 Buffering Output To The Browser 187 -- 8.13 Compressing Web Output With Gzip 189 -- 8.14 Hiding Error Messages From Users 190 -- 8.15 Tuning Error Handling 191 -- 8.16 Using A Custom Error Handler 193 -- 8.17 Logging Errors 194 -- 8.18 Eliminating Headers Already Sent Errors 195 -- 8.19 Logging Debugging Information 197 -- 8.20 Reading Environment Variables 199 -- 8.21 Setting Environment Variables 200 -- 8.22 Reading Configuration Variables 201 -- 8.23 Setting Configuration Variables 202 -- 8.24 Communicating Within Apache 203 -- 8.25 Profiling Code 204 -- 8.26 Program: Website Account (de)activator 208 -- 8.27 Program: Abusive User Checker 210 -- 9. Forms 216 -- 9.1 Processing Form Input 218 -- 9.2 Validating Form Input 219 -- 9.3 Working With Multipage Forms 221 -- 9.4 Redisplaying Forms With Preserved Information And Error Messages 224 -- 9.5 Guarding Against Multiple Submission Of The Same Form 227 -- 9.6 Processing Uploaded Files 229 -- 9.7 Securing Php's Form Processing 231 -- 9.8 Escaping Control Characters From User Data 233 -- 9.9 Handling Remote Variables With Periods In Their Names 234 -- 9.10 Using Form Elements With Multiple Options 235 -- 9.11 Creating Dropdown Menus Based On The Current Date 236 -- 10. Database Access 238 -- 10.1 Using Text-file Databases 243 -- 10.2 Using Dbm Databases 244 -- 10.3 Connecting To A Sql Database 248 -- 10.4 Querying A Sql Database 250 -- 10.5 Retrieving Rows Without A Loop 252 -- 10.6 Modifying Data In A Sql Database 254 -- 10.7 Repeating Queries Efficiently 255 -- 10.8 Finding The Number Of Rows Returned By A Query 257 -- 10.9 Escaping Quotes 258 -- 10.10 Logging Debugging Information And Errors 259 -- 10.11 Assigning Unique Id Values Automatically 262 -- 10.12 Building Queries Programmatically 263 -- 10.13 Making Paginated Links For A Series Of Records 267 -- 10.14 Caching Queries And Results 272 -- 10.15 Program: Storing A Threaded Message Board 274 -- 11. Web Automation 281 -- 11.1 Fetching A Url With The Get Method 283 -- 11.2 Fetching A Url With The Post Method 285 -- 11.3 Fetching A Url With Cookies 287 -- 11.4 Fetching A Url With Headers 289 -- 11.5 Fetching An Https Url 290 -- 11.6 Debugging The Raw Http Exchange 290 -- 11.7 Marking Up A Web Page 293 -- 11.8 Extracting Links From An Html File 295 -- 11.9 Converting Ascii To Html 296 -- 11.10 Converting Html To Ascii 297 -- 11.11 Removing Html And Php Tags 298 -- 11.12 Using Smarty Templates 299 -- 11.13 Parsing A Web Server Log File 301 -- 11.14 Program: Finding Stale Links 303 -- 11.15 Program: Finding Fresh Links 305 -- 12. Xml 309 -- 12.1 Generating Xml Manually 311 -- 12.2 Generating Xml With The Dom 313 -- 12.3 Parsing Xml With The Dom 316 -- 12.4 Parsing Xml With Sax 319 -- 12.5 Transforming Xml With Xslt 323 -- 12.6 Sending Xml-rpc Requests 326 -- 12.7 Receiving Xml-rpc Requests 329 -- 12.8 Sending Soap Requests 333 -- 12.9 Receiving Soap Requests 336 -- 12.10 Exchanging Data With Wddx 338 -- 12.11 Reading Rss Feeds 340 -- 13. Regular Expressions 343 -- 13.1 Switching From Ereg To Preg 346 -- 13.2 Matching Words 348 -- 13.3 Finding The Nth Occurrence Of A Match 349 -- 13.4 Choosing Greedy Or Nongreedy Matches 350 -- 13.5 Matching A Valid Email Address 352 -- 13.6 Finding All Lines In A File That Match A Pattern 355 -- 13.7 Capturing Text Inside Html Tags 355 -- 13.8 Escaping Special Characters In A Regular Expression 357 -- 13.9 Reading Records With A Pattern Separator 359 -- 14. Encryption And Security 361 -- 14.1 Keeping Passwords Out Of Your Site Files 362 -- 14.2 Obscuring Data With Encoding 363 -- 14.3 Verifying Data With Hashes 364 -- 14.4 Storing Passwords 366 -- 14.5 Checking Password Strength 367 -- 14.6 Dealing With Lost Passwords 369 -- 14.7 Encrypting And Decrypting Data 371 -- 14.8 Storing Encrypted Data In A File Or Database 375 -- 14.9 Sharing Encrypted Data With Another Web Site 378 -- 14.10 Detecting Ssl 380 -- 14.11 Encrypting Email With Gpg 381 -- 15. Graphics 383 -- 15.1 Drawing Lines, Rectangles, And Polygons 386. David Sklar And Adam Trachtenberg. Solutions & Examples For Php Programmers--cover. Includes Bibliographical References (p. Xvii-xix) And Index. PHP is a simple yet powerful open source scripting language that has become a big player in web development. Over a million web sites, from large corporate sites to small personal sites, are using PHP to serve dynamic web content. PHP's broad feature set, approachable syntax, and support for different operating systems and web servers make it an ideal language for rapid web development. 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. For every problem addressed in the book, there's a worked-out solution or "recipe" -- short, focused pieces of code that you can insert directly into your applications. But this book offers more than cut-and-paste code. You also get explanations of how and why the code works, so you can learn to adapt the problem-solving techniques to similar situations. The recipes in the PHP Cookbook range from simple tasks, such as sending a database query and fetching URLs, to entire programs that demonstrate complex tasks, such as printing HTML tables and generating bar charts. This book contains over 250 recipes on the following topics: Working with basic data types, including strings, numbers, dates and times, and arrays PHP building blocks, such as variables, functions, classes, and objects Web programming, including forms, database access, and XML Useful features like regular expressions, encryption and security, graphics, internationalization and localization, and Internet services Working with files and directories Command-line PHP and PHP-GTK PEAR, the PHP Extension and Application Repository This book contains an impressive collection of useful code for PHP programmers, from novices to advanced practitioners. Instead of poking around mailing lists, online documentation, and other sources, you can rely on the PHP Cookbook to provide quick solutions to common problems, so you can spend your time on those out-of-the-ordinary problems specific to your application
دانلود کتاب Oreilly Php Cookbook