skip navigation

Content:: PHP

Last Modified: 2009-10-27
A small collection of classes, functions, examples, and small projects.

Table of Contents
Array Strip Slashes
Array Strip Slashes is nearly identical to the php function stripslashes except it recursively goes through arrays.
Download 1,576 bytes
MD5 - baeb84483a4c2fadf9cd3eada5d29bed *
BB Code to HTML
Original Code concept and over 90% of the code from
This will convert BB Codes ([b][i][url=""]) to HTML Code (<b><i><a href="">)
Download 2,305 bytes
MD5 - f02621187ef8381b4f5b85fad82b1edd *
Benchmark Timer
Three functions to determine your script time. Set start and end timers with benchmark_time() and calculate the time between with benchmark_calculate()
Download 1,845 bytes
MD5 - 5dc88c42775c48ac6bc5923f3e86be1e *
Convert Smart Quotes
A simple function to take a string of input and replace the "Smart Quotes" with HTML Special Characters. If you have users that copy and paste from a microsoft word document this function will come in handy.
Download 1,670 bytes
MD5 - 76929e66cce17390562a4f8bbd47815a *
Database Connectivity Class
Connecting to databases is simple in PHP, but the lack of error checking and messages can be a drag writing over and over. This class adds simple error messages or null returns. Ability to terminate program or continue upon error. Better yet theres one simple configuration file to be used with all your connections. Works with mysql and mssql (mssql with freetds).
Download 4,846 bytes
MD5 - 2fff65472e9c17abffdd18787bc7297c *
Download 6,828 bytes
MD5 - 16df4a10a9ec34f62d2a8225785c69d4 *
Form Process Class
The Form Process Class takes static and dynamic form files in html format and does simple processing.
Included is a basic captcha security script from

View Example
Download 27,585 bytes
8301f164654d60b0f578e7af1b73351c *
Simple Template Structure
Reads a "template" header, body, and footer and replaces special template tags with your content. E.G. [content] with your string. Simple bracket [] parsing.
This purpose of this script is to separate HTML code from PHP code. Allow the web page designers to work with the dynamic coders. The majority of the code in the template class will probably never be used, 90% of it was created for testing purposes to help me determine what could be used in a small production environment.
This script mainly uses pregmatch to replace strings surrounded by [] with html content from a file. This script can easily be modified to pull data from a database or any other content source.
Download 3,222 bytes
MD5 - 36ebe0d2006d94c408ebe2ad4cce869f *