Home >> Snippet List

PHP Code Snippets

<<first    <prev    1  2  3  4  5  6  (7) 8  9       next>     last>>
  • Pre-populated List of Countries - A handy array pre-populated with the world's countries...
  • Prompt user at command line - From the command line mode, prompt a user for keyboard input...
  • Pronouncable password generator - Password generation function for PHP It allows the developer to custo...
  • Protect Writable Directory - Use this in writeable directories in htaccess This prevents execution of...
  • Quick calendar example - Very easy calendar generating code...
  • Quickly sort associative arrays - A "quick sort" function for associative arrays...
  • Random banner picker - Automatic banner rotation Randomly selects a banner for display...
  • Random Image from Directory - Spits out a random image path from a given directory...
  • Random Pronounceable Passwords - Produces nice random-yet-pronounceable passwords...
  • Read gzip File - This function will get contents of a gzip file into a string...
  • Really Get File Extension - A function that gets the real file extension Returns an empty string if fil...
  • Recursive Directory Browser - This function takes in a directory path and recursively searches through ...
  • Recursive fopen() function - A small function useful for backup and other things It's a mix between the...
  • Recursive function to generate a parent/child tree - This is a simple PHP script to generate a Category...
  • Recursively traverse array - A recursive function to traverse a multi-dimensional array where the dim...
  • Regex Matching Patterns - Some miscellaneous regex patterns to match common items...
  • Remote file_exist() - Use this if you want to check if a remote file exists...
  • Remove all non-ASCII chars - Removes all non-ASCII chars (like "", "", "", etc) Great for sanitizing...
  • Remove extra linebreaks - Won't allow more than two linebreaks tags in a row...
  • Remove Extra Spaces From A String - Three ways to remove extra spaces from string and replace them with...
  • Reversible Encryption in PHP - Mcrypt is a PHP function that uses encryption algorithms It can be used ...
  • Roman2dec and Dec2Roman - A function that converts to and from Roman numerals...
  • Rounded random numbers - Make nice, clean random numbers This example will return a whole number betwee...
  • Saving Remote Images With PHP - Two ways to save remote images with PHP The second way is useful if the...
  • Search All Words Of A String In mySQL - This code will break a string of words up along the spaces and ...
  • Search and Replace On Every Field In Every Table - This script will do a global search and replace on e...
  • Search array elements for a substring - Searches all array elements for a given substring This function...
  • Secure Auto-Link Maker - A more secure version of the link conversion code which will hopefully make cr...
  • Select (dropdown) list generator - Makes a dropdown (SELECT) list...
  • Send iCal Email Meeting Requests using PHP - Awesome function from Julian Young Send iCal Email Meetin...
  • <<first    <prev    1  2  3  4  5  6  (7) 8  9       next>     last>>