Home >> Snippet List

PHP Code Snippets

(1) 2  3  4  5  6  7  8  9       next>     last>>
  • Add a period at the end of a string if there isn't one there already - Simple way to add a period a...
  • Add and Subtract dates - You can combine strtotime with the date function to create your own date This ...
  • Add dashes to credit card numbers - Easily add dashes to credit card numbers...
  • Alternate Title Case function - Intelligently converts a string into title case...
  • Anti-Flood Protection - This script will redirect the user when he or she makes too many requests on yo...
  • Anti-SQL Injection Function - Simple function to help stop SQL Injection attacks Use this for login fun...
  • Array of all US states - Handy pre-made array of all US states...
  • Auto Link Maker #2 - Automatically creates links 'http:' and 'mailto:' strings in text...
  • Auto Link Maker - Automatically make active links to URLs Works for both 'http:' and 'mailto:' links...
  • Automatically process email - Automatically process an email with attachment(s) using PHP and PEAR Mail...
  • Awesome Date Time Conversion Kit - Awesome Mysql date-time converter kit Real-life functions you ca...
  • Bad Word Filter - Replaces bad words, censoring the text passed in automatically...
  • Ban Proxy Servers - Bans most (but not all) proxy servers by detecting common "FORWARD" signatures in t...
  • Base 64 Decode - I recently ran across a freeware web application written in PHP that utilized the foll...
  • Basic PHP Calendar - Easy to modify PHP Calendar that displays the current month...
  • Basic currency conversion Convert 1 dollar to pounds using Yahoos conversion - Convert 1 dollar to pou...
  • Basic PHP Calendar - Easy to modify PHP Calendar that displays the current month...
  • Binary to Text / Text to Binary - Binary to Text and Text to Binary printer...
  • Block IP Addresses - The above code creates an array of IP address to be blocked and checks the incomin...
  • BR2NL Function - Opposite of NL2BR - Simple way to do the opposite of what the nl2br() function does- t...
  • Browser sniffer / detector - Simple code that displays the HTTP_USER_AGENT of the client...
  • Bubblesort routine - Reasonably quick bubblesort routine...
  • Buffered Download code - For downloading very large files (10 meg or more), split the file into chunks ...
  • Build Date Select Boxes - A function that builds select boxes for the month,day,and year It will defaul...
  • Build HTML select list from table - This function builds an HTML select list from from data retrieved f...
  • Build select menu from database - This small function is used to build a select menu with the values fr...
  • Calculate date of Easter Sunday - Correctly calculate the date of Easter Sunday...
  • Calculate Distance - Calculates the distance between two pairs of latitude longitude coordinates Return...
  • Calculate File Size In Directory - This is a PHP Class that calculates the size, number of files & fold...
  • Calculate the difference between two times formatted in HH:MM - A script that calculates the difference...
  • (1) 2  3  4  5  6  7  8  9       next>     last>>