
Problem-Solution Approach
A Problem-Solution Approach
By:Â Lee Babin, Jon Stephens, Frank M. Kromann
Paperback | 1 September 2005
At a Glance
676 Pages
24.13 x 18.42 x 3.81
Paperback
$64.99
or 4 interest-free payments of $16.25 with
 orÂShips in 5 to 7 business days
| About the Authors | p. xv |
| About the Technical Reviewer | p. xvii |
| Introduction | p. xix |
| Overview of PHP Data Types and Concepts | p. 1 |
| Variables | p. 2 |
| Numbers | p. 4 |
| Arrays | p. 5 |
| Strings | p. 6 |
| Regular Expressions | p. 7 |
| Functions | p. 8 |
| Project: Finding the Data Type of a Value | p. 10 |
| Project: Discovering What Variables, Constants, Functions, Classes, and Interfaces Are Available | p. 12 |
| Getting Information About the Current Script | p. 14 |
| Summary | p. 19 |
| Looking Ahead | p. 19 |
| Overview of Classes, Objects, and Interfaces | p. 21 |
| Understanding Basic Concepts | p. 22 |
| Creating Instances Using Constructors | p. 24 |
| Using Default Constructors | p. 26 |
| Setting Object Properties | p. 27 |
| Controlling Access to Class Members | p. 30 |
| Using Static Members and the self Keyword | p. 33 |
| Using Class Constants | p. 37 |
| Extending Classes | p. 43 |
| Using Abstract Classes and Methods | p. 50 |
| Using Interfaces | p. 53 |
| Using Class Destructors | p. 55 |
| Using Exceptions | p. 56 |
| Getting Information About Classes and Objects | p. 61 |
| Using Class and Object Functions | p. 61 |
| Checking for the Existence of Classes and Interfaces Using class_exists() and interface_exists() | p. 63 |
| Listing Methods and Interfaces Using get_class_methods() | p. 65 |
| Obtaining Variable Names | p. 66 |
| Determining Whether an Object Is an Instance of a Particular Class | p. 67 |
| Listing Currently Loaded Interfaces and Classes | p. 69 |
| Using the Class Reflection API | p. 71 |
| Obtaining a Dump of the Reflection API | p. 73 |
| Performing Dynamic Class Instantiation | p. 76 |
| Using the Reflection API to Deconstruct the Shape Class | p. 77 |
| Summary | p. 82 |
| Looking Ahead | p. 83 |
| Performing Math Operations | p. 85 |
| Numeric Data Types | p. 85 |
| Random Numbers | p. 95 |
| Logarithms and Exponents | p. 100 |
| Trigonometric Functions | p. 105 |
| Formatting of Numeric Data | p. 108 |
| Math Libraries | p. 113 |
| A Static Math Class | p. 116 |
| Summary | p. 119 |
| Looking Ahead | p. 119 |
| Working with Arrays | p. 121 |
| Creating Arrays | p. 122 |
| Accessing Array Elements | p. 122 |
| Creating Multidimensional Arrays | p. 123 |
| Using Array Keys | p. 124 |
| Initializing an Array As a Range or Sequence of Values | p. 124 |
| Outputting Arrays | p. 126 |
| Outputting an Array As a String | p. 126 |
| Outputting Using array_values() and array_keys() for Backward Compatibility | p. 126 |
| Outputting an Array As a Tree | p. 128 |
| Adding New Elements to Arrays | p. 131 |
| Adding an Element to the End of an Array | p. 131 |
| Appending One Array to Another | p. 132 |
| Comparing Arrays | p. 135 |
| Adding an Element to the Beginning of an Array | p. 137 |
| Inserting New Values at an Arbitrary Point in an Indexed Array | p. 137 |
| Getting and Setting the Size of an Array | p. 139 |
| Counting Array Elements | p. 139 |
| Setting an Array's Size | p. 141 |
| Traversing Arrays | p. 144 |
| Looping Through an Associative Array Using foreach | p. 144 |
| Looping Through a Compact Indexed Array Using for and count() | p. 145 |
| Looping Through a Sparse Array | p. 146 |
| Removing Elements from Arrays | p. 147 |
| Removing the First or Last Element from an Array | p. 148 |
| Removing One or More Arbitrary Array Elements | p. 150 |
| Extracting a Portion of an Array | p. 152 |
| Extracting Values from Arrays with extract() | p. 154 |
| Extracting Values from an Array Using list() | p. 156 |
| Combining Arrays | p. 158 |
| Obtaining Array Keys and Values | p. 159 |
| Working with Unique Values | p. 160 |
| Getting and Displaying Counts of Array Values | p. 161 |
| Finding and Working with Array Values | p. 162 |
| Determining Whether an Element Is in an Array | p. 163 |
| Testing for the Existence of a Key in an Array | p. 164 |
| Obtaining Array Keys with a Given Value | p. 165 |
| Finding the Greatest and Least Values in an Array | p. 166 |
| Finding the Sum and Average of the Values in an Array | p. 168 |
| Applying Functions to Arrays | p. 169 |
| Applying Functions to Array Elements Using array_walk() | p. 170 |
| Applying Functions to Array Elements Using array_map() | p. 173 |
| Filtering Arrays Using array_filter() | p. 175 |
| Sorting Arrays | p. 178 |
| Sorting an Array by Its Values | p. 178 |
| Sorting an Array by Its Keys | p. 180 |
| Reversing an Array Using arsort() | p. 181 |
| Reversing an Array Using krsort() | p. 182 |
| Reversing an Array Using array_reverse() | p. 182 |
| Randomizing an Array Using shuffle(), kshuffle(), and array_rand() | p. 183 |
| Sorting an Array Using Comparison Functions | p. 184 |
| Sorting Multidimensional Arrays | p. 186 |
| Sorting Multiple Arrays | p. 189 |
| Finding Permutations and Combinations | p. 190 |
| Finding All Permutations of an Array's Elements | p. 190 |
| Finding All Combinations of an Array's Elements | p. 193 |
| Summary | p. 194 |
| Looking Ahead | p. 195 |
| Working with Dates and Times | p. 197 |
| Overview of PHP 5's Date and Time Functions | p. 198 |
| Displaying Dates and Times | p. 200 |
| Displaying Human-Readable Dates and Times | p. 201 |
| Displaying Arbitrary Dates and Times | p. 204 |
| Converting Human-Readable Dates Into Unix Timestamps Using strtotime() | p. 205 |
| Finding the Date for a Weekday | p. 207 |
| Getting the Day and Week of the Year | p. 211 |
| Determining Whether a Given Year Is a Leap Year | p. 213 |
| Getting Times and Dates of Files | p. 214 |
| Setting Time Zones and GMT/UTC | p. 216 |
| Displaying Times and Dates in Other Languages | p. 219 |
| Generating Localized GMT/UTC Time and Date Strings | p. 224 |
| Obtaining the Difference Between Two Dates | p. 225 |
| Project: Constructing and Using a Date Class | p. 231 |
| Extending the Date Class | p. 250 |
| Summary | p. 263 |
| Looking Ahead | p. 264 |
| Working with Strings | p. 265 |
| Manipulating Substrings | p. 266 |
| Testing for Substrings | p. 267 |
| Counting the Occurrences of a Substring | p. 269 |
| Accessing Substrings | p. 269 |
| Using Substring Alternatives | p. 270 |
| Replacing Substrings | p. 271 |
| Processing Strings | p. 273 |
| Joining and Disassembling Strings | p. 273 |
| Reversing Strings | p. 277 |
| Controlling Case | p. 277 |
| Trimming Blank Spaces | p. 279 |
| Wrapping Text | p. 280 |
| Checking String Length | p. 282 |
| Comparing Strings | p. 283 |
| Comparing Sound | p. 284 |
| Project: Creating and Using a String Class | p. 285 |
| Using a Page Reader Class | p. 285 |
| Summary | p. 290 |
| Looking Ahead | p. 290 |
| Working with Files and Directories | p. 291 |
| Working with Files | p. 291 |
| Opening Files | p. 291 |
| Reading from Files | p. 293 |
| Writing to Files | p. 295 |
| Closing Files | p. 296 |
| Reading and Writing Comma-Separated Data | p. 298 |
| Reading Fixed-Width Delimited Data | p. 300 |
| Reading and Writing Binary Data in a File | p. 301 |
| Getting the Number of Lines in a File | p. 303 |
| Getting the Number of Characters, Words, or Paragraphs in a File | p. 304 |
| Project: Creating and Using a File Class | p. 305 |
| Working with Directories | p. 309 |
| Listing All Files in the Current Directory | p. 310 |
| Listing All Files of a Certain Type | p. 311 |
| Sorting Files by Date | p. 313 |
| Generating a Recursive Directory Listing | p. 314 |
| Using the SPL Directorylterator Object | p. 316 |
| Summary | p. 319 |
| Looking Ahead | p. 319 |
| Working with Dynamic Imaging | p. 321 |
| Working with Image Types | p. 321 |
| Working with JPGs | p. 321 |
| Working with GIFs | p. 323 |
| Working with PNGs | p. 325 |
| Working with Image Libraries | p. 327 |
| Creating an Image from Scratch | p. 327 |
| Creating a Blank Canvas | p. 328 |
| Creating and Using Colors | p. 329 |
| Creating and Applying Different Shapes and Patterns | p. 331 |
| Outputting an Image | p. 334 |
| Creating an Image from an Existing Image | p. 336 |
| Loading an Existing Image | p. 337 |
| Applying Modifications to an Existing Image | p. 338 |
| Saving and Outputting the Modified Image | p. 340 |
| Using True Type Fonts | p. 341 |
| Loading Fonts | p. 342 |
| Applying True Type Fonts to an Image | p. 343 |
| Project: Creating and Using a Dynamic Thumbnail Class | p. 345 |
| Summary | p. 349 |
| Looking Ahead | p. 349 |
| Using Regular Expressions | p. 351 |
| Overview of Regular Expression Syntax | p. 351 |
| Qualifiers | p. 352 |
| Ranges | p. 352 |
| Line Anchors | p. 352 |
| An Escape | p. 353 |
| Saying OR | p. 353 |
| Character Classes | p. 353 |
| POSIX vs. PCRE | p. 353 |
| POSIX | p. 354 |
| PCRE | p. 355 |
| Putting Regular Expressions to Work | p. 356 |
| Using String Matching vs. Pattern Matching | p. 356 |
| Finding the nth Occurrence of a Match | p. 358 |
| Matching with Greedy vs. Nongreedy Expressions | p. 358 |
| Matching a Valid IP Address | p. 360 |
| Validating Pascal Case Names | p. 361 |
| Validating U.S. Currency | p. 363 |
| Formatting a Phone Number | p. 365 |
| Finding Repeated Words | p. 367 |
| Finding Words Not Followed by Other Words | p. 368 |
| Matching a Valid E-mail Address | p. 369 |
| Finding All Matching Lines in a File | p. 371 |
| Finding Lines with an Odd Number of Quotes | p. 372 |
| Capturing Text Inside HTML or XML Tags | p. 373 |
| Escaping Special Characters | p. 375 |
| Replacing URLs with Links | p. 377 |
| Replacing Smart Quotes with Straight Quotes | p. 380 |
| Testing the Complexity of Passwords | p. 380 |
| Matching GUIDs/UUIDs | p. 381 |
| Reading Records with a Delimiter | p. 382 |
| Creating Your Own RegExp Class | p. 385 |
| Summary | p. 391 |
| Looking Ahead | p. 391 |
| Working with Variables | p. 393 |
| Using Variable Types | p. 394 |
| Assigning and Comparing | p. 396 |
| Typecasting | p. 402 |
| Using Constants | p. 408 |
| Defining Variable Scope | p. 411 |
| Parsing Values to Functions | p. 417 |
| Using Dynamic Variable and Function Names | p. 421 |
| Encapsulating Complex Data Types | p. 425 |
| Sharing Variables Between Processes | p. 429 |
| Debugging | p. 431 |
| Summary | p. 435 |
| Looking Ahead | p. 435 |
| Using Functions | p. 437 |
| Accessing Function Parameters | p. 437 |
| Setting Default Values for Function Parameters | p. 438 |
| Passing Values by Reference | p. 439 |
| Creating Functions That Take a Variale Number of Arguments | p. 440 |
| Returning More Than One Value | p. 442 |
| Returning Values by Reference | p. 443 |
| Returning Failure | p. 445 |
| Calling Variable Functions | p. 446 |
| Accessing a Global Variable from Within a Function | p. 447 |
| Creating Dynamic Functions | p. 449 |
| Summary | p. 450 |
| Looking Ahead | p. 451 |
| Understanding Web Basics | p. 453 |
| Using Cookies | p. 453 |
| Setting Cookies | p. 454 |
| Reading Cookies | p. 455 |
| Deleting Cookies | p. 456 |
| Writing and Using a Cookie Class | p. 457 |
| Using HTTP Headers | p. 459 |
| Redirecting to a Different Location | p. 460 |
| Sending Content Types Other Than HTML | p. 461 |
| Forcing File "Save As" Downloads | p. 462 |
| Using Sessions | p. 463 |
| Implementing Sessions | p. 464 |
| Storing Simple Data Types in Sessions | p. 465 |
| Storing Complex Data Types in Sessions | p. 466 |
| Detecting Browsers | p. 467 |
| Using Querystrings | p. 470 |
| Using Querystrings | p. 470 |
| Passing Numeric Values in a Querystring | p. 471 |
| Passing String Values in a Querystring | p. 472 |
| Passing Complex Values in a Querystring | p. 473 |
| Authenticating Your Users | p. 475 |
| Setting Up HTTP-Based Authentication | p. 475 |
| Setting Up Cookie Authentication | p. 481 |
| Using Environment and Configuration Variables | p. 484 |
| Reading Environment and Configuration Variables | p. 484 |
| Setting Environment and Configuration Variables | p. 485 |
| Summary | p. 486 |
| Looking Ahead | p. 486 |
| Creating and Using Forms | p. 487 |
| Understanding Common Form Issues | p. 487 |
| GET vs. POST | p. 488 |
| Superglobals vs. Globals | p. 490 |
| Validating Form Input | p. 491 |
| Working with Multipage Forms | p. 494 |
| Redisplaying Forms with Preserved Information and Error Messages | p. 496 |
| Preventing Multiple Submissions of a Form | p. 499 |
| Preventing Multiple Submissions on the Server Side | p. 499 |
| Preventing Multiple Submissions on the Client Side | p. 500 |
| Performing File Uploads | p. 502 |
| Handing Special Characters | p. 505 |
| Creating Form Elements with Multiple Options | p. 506 |
| Creating Form Elements Based on the Current Time and/or Date | p. 508 |
| Summary | p. 510 |
| Looking Ahead | p. 511 |
| Working with Markup | p. 513 |
| Understanding Markup Concepts | p. 513 |
| Manually Generating Markup | p. 514 |
| Using DOM to Generate Markup | p. 516 |
| Creating and Setting Attributes | p. 520 |
| Parsing XML | p. 523 |
| Transforming XML with XSL | p. 528 |
| Using RSS Feeds | p. 531 |
| Using WDDX | p. 539 |
| Using SOAP | p. 542 |
| Summary | p. 549 |
| Looking Ahead | p. 549 |
| Using MySQL Databases in PHP 5 | p. 551 |
| Basic Database Concepts | p. 551 |
| Connecting to a MySQL Database | p. 551 |
| Querying the Database | p. 553 |
| Retrieving and Displaying Results | p. 555 |
| Modifying Data | p. 557 |
| Deleting Data | p. 559 |
| Building Queries on the Fly | p. 561 |
| The mysqli Extension vs. the PHP 4 MySQL Extension | p. 564 |
| Using the mysqli Object-Oriented API | p. 564 |
| Using Exceptions to Handle Database Errors | p. 567 |
| Project: Displaying Linked Search Results | p. 571 |
| Displaying Results in a Form | p. 576 |
| Project: Bridging the Gap Between mysql and mysqli | p. 579 |
| Discovering Which Extension Is Being Used | p. 579 |
| Writing a Wrapper Class to Bridge the Gap | p. 580 |
| Project: Going from MySQL to XML and from XML to MySQL | p. 585 |
| Summary | p. 596 |
| Looking Ahead | p. 596 |
| Communicating with Internet Services | p. 597 |
| Sending Internet Mail | p. 597 |
| Project: Sending an E-mail with a Mail Class | p. 599 |
| Reading Mail with IMAP or POP3 | p. 602 |
| Getting and Putting Files with FTP | p. 614 |
| Performing DNS Lookups | p. 621 |
| Checking Whether a Host Is Alive | p. 623 |
| Getting Information About a Domain Name | p. 627 |
| Summary | p. 629 |
| Index | p. 631 |
| Table of Contents provided by Ingram. All Rights Reserved. |
ISBN: 9781590595091
ISBN-10: 1590595092
Series: Problem-Solution Approach
Published: 1st September 2005
Format: Paperback
Language: English
Number of Pages: 676
Audience: General Adult
Publisher: Springer Nature B.V.
Country of Publication: US
Dimensions (cm): 24.13 x 18.42 x 3.81
Weight (kg): 1.16
Shipping
| Standard Shipping | Express Shipping | |
|---|---|---|
| Metro postcodes: | $9.99 | $14.95 |
| Regional postcodes: | $9.99 | $14.95 |
| Rural postcodes: | $9.99 | $14.95 |
Orders over $0.00 qualify for free shipping.
How to return your order
At Booktopia, we offer hassle-free returns in accordance with our returns policy. If you wish to return an item, please get in touch with Booktopia Customer Care.
Additional postage charges may be applicable.
Defective items
If there is a problem with any of the items received for your order then the Booktopia Customer Care team is ready to assist you.
For more info please visit our Help Centre.
You Can Find This Book In

Architecture Patterns with Python
Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices
Paperback
RRP $125.75
$100.60
OFF
This product is categorised by
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentProgramming & Scripting Languages
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentWeb Programming
- Non-FictionComputing & I.T.Digital Lifestyle & Online World: Consumer & User GuidesInternet Guides & Online Services
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentSoftware Engineering























