Home >> Snippet List

PHP Code Snippets

<<first    <prev    1  2  (3) 4  5  6  7  8  9       next>     last>>
  • Count days between dates - Find how many days there are between two given dates...
  • Count lines in file - Count the number of lines in a text file...
  • Count words in string - This will count through the sentences in a section of text and show how many wo...
  • Create a drop down menu from an array list - A short snippet that creates a drop down menu from an arra...
  • Create an HTML page on demand - Creating an HTML page on the fly This could easily be populated from in...
  • Create Basic PDF - Very basic example of creating a PDF file...
  • Create gzip file - Basic example of creating gzip file on the fly...
  • Create mySQL table with PHP - Good for install scripts or automated table building...
  • Create thumbnails with PHP - Simple function that creates thumbnail images using PHP and the GD image l...
  • CSS Colornames to RGB values - The GetColor function returns an associative array with the red, green...
  • Currency display formatting function - Great function to display a variety of currency formats from aro...
  • CyberCash payment class - A class for doing payments to a CyberCash server...
  • Days in month #1 - Returns the number of days in the month for this month and this year...
  • Days in month #2 - Returns the number of days in the month for this month and this year...
  • De-Pluralize a String - A snippet that will take a given string and if it is plural, the 's' will be re...
  • Decimal to octal conversion - Easy decimal to octal conversion example...
  • Define a schedule of holidays - Functions used to define a schedule of holidays Can define non-fixed ho...
  • Define schedule of holidays - Functions used to define a schedule of holidays...
  • Delete all cookies set - This code snippet which will delete all cookies currently set by a website...
  • Delete all files in directory - This is a simple function that will take a folder path and remove all o...
  • Delete by date - The snippet of code earlier that allows you to delete all files older than 2 weeks use...
  • Delete by wildcard - The simplest way to delete all files of a particular extension is to use the glob(...
  • Delete files older than 'X' - Quick and dirty code for cleaning out a directory of files so many second...
  • Detect Mobile/WAP browser - This code will detect most Mobile/WAP browsers Useful for serving up differ...
  • Directory Listing #2 - Lists all the items in a directory including folders and files...
  • Directory Listing - A simple script that lists all the items in the directory including folders and fil...
  • Display html source with line numbers - Great way to show the html source of a page complete with line ...
  • Display stock quotes from a CSV file - Displays formatted stock quotes from a dynamically retrieved CSV...
  • Download File To Client - Here's a function for sending a file to the client - it may look more complic...
  • Easily detect Odd/Even numbers - This is a simple way to tell whether a given number is odd or even It ...
  • <<first    <prev    1  2  (3) 4  5  6  7  8  9       next>     last>>