PHP Web Development

Listed here is the collection of PHP snippets developed using PHP version 5.x. All these snippets, like the rest elsewhere in the lexicon, have been well tested and are fully functioning. The notes for each snippet may also list additional information about the version of database used or special extensions that must be enabled to use them.

Snippet Listing

Add Mail AttachmentBinary Search in PHP
Calculate Letter Grade From PercentageCheck Image Dimensions
Clean DB Field Data for Excel ExportCompare Two Dates in PHP
Count Days Between Two Timestamps in PHPGenerate Password
Last Day of a Given MonthLeap Year Check in PHP
Log String or Array to FilePlace Ship Into Battleship Game Board
Strip HTML Tags From ArrayValidate Email Address in PHP
Validate IP Address in PHP