Home >> Snippet List
PHP Code Snippets
Calculate Zipcode Distances - This routine calculates the distance between two points (given the
... Calendar for any month any year - Simple, nice looking calendar displays any month and year... Call a PHP function when clicking on an HTML button - Use the onclick() event listener in the button to... Call a PHP function when clicking on an HTML button - Use the onclick() event listener in the button to... CAPTCHA w/ GD Image Library - Simple CAPTCHA that uses the GD Image library... Censor Message Text - Fill the "$bw" string with bad words separated by a pipe symbol and then run your... Check if a file exists - Use PHP to check if a file exists or not... Check if an image exists (GD) - Check if an image exists using the GD library... Check if array is associative - The is_assoc_array function checks if given array is associative or not... Check If Domain Exists - Checks if a domain is reachable on the internet... Check number of characters in a range - This code checks to see if the number of characters is within i... Check syntax of multiple PHP files all at once - To check the syntax of all files ending with a 'php' f... Checking Server Status with PHP - A small bit of code to check server status and report the results Eas... Collapse multiple spaces or dashes - Collapse multiple space or dash characters into a single character... Combining three arrays into one - This code combines three arrays into one multidimensional array... Combining two arrays into one - A quick bit of code for combining two arrays into one... Convert 12 to 24 hour time and vice versa - Convert 24-hour format to 12-hour format Also works in the ... Convert BBCode Tags - Compact function that converts BBCode tags to their HTML equivalent... Convert Hours to Minutes - Simple hours to minutes conversion code... Convert HTML to plain text - If you want to extract the text content of a HTML document (eg - get rid o... Convert miles to feet, feet to miles, or inches. - Handy function to convert miles to feet, feet to mil... Convert minutes to hours #1 - Convert minutes into an HH:mm format... Convert minutes to hours #2 - Convert minutes to a decimal hours and minutes format, ie "125" hours... Convert Minutes to Hours - Another "Minutes to Hours" conversion script... Convert Seconds to Hours:Minutes:Seconds - This function will convert a given number of seconds to hour... Convert UK Dates To mySQL Format Dates - Handy function that will convert a UK date style (dd/mm/yyyy) ... Cookie Login Code - Shows a basic cookie-based "Remember Me" function... Copy a remote file to your site - Copies any file (image, zip, swf, etc) from a remote site to a file o... Copy File From Server - This will retrieve a text file from a remote server and write it to yours... Count capital letters in a string - Two easy ways to find how many capital letters there are in a strin...