Home >> Snippet List

PHP Code Snippets

<<first    <prev    1  2  3  4  (5) 6  7  8  9       next>     last>>
  • Get file extension - Reliable way to get the file extension- this will print the last part after the la...
  • Get file in as variable - You can read the whole content of a file into a variable with this statement...
  • Get filesize without downloading - Nifty way to get the size of a file without having to download it fi...
  • Get last added insert ID - Get the id of an auto_incrementing id from a mySQL insert...
  • Get Link Text - Gets just the text of a URL link...
  • Get oldest file in directory - Shows the oldest file in directory...
  • Get Path Info - The example given (/www/psoug/indexhtml) would produce: /www/psoug indexhtml h...
  • Get Relative Dates and Times - This function takes seconds as an argument and returns the time differen...
  • Get text between tags - Gets the text between any pair of tags, matching or not...
  • Get week number - This function returns the week number of the given date according to ISO 8601-1988...
  • GoogleBot monitor - This script notifies you when Google bot visits your page Copy this into the page a...
  • Gradient Image Generator - The default gradient is set at black->white To change it, just add the start...
  • Graphical tree like Explorer - This code displays a graphical tree (similar to that of Windows' Explore...
  • Handy SORT BY box - This code produces a sort box for any number of arbitrary criteria on any type of d...
  • Heavy-duty SendMail function - A heavy-duty SendMail function...
  • Heavy Duty URL validator - A heavy-duty URL validator that should work on nearly any valid URL...
  • HEX Encode / Decode - Here is a nice way to use preg_replace to convert a hex encoded string back to cl...
  • HEX to RGB array - Function to convert a string with hexadecimal colors to an associative array with RG...
  • Hierarchical categories browser - A very simple way to build and do a hierarchical HTML categories brow...
  • Highlight Words #2 - Highlight words in a string...
  • How many days ago - Takes a date and returns a string describing how long ago that date was, ie 2 days ...
  • How to write a config file - Easy way to collect user data and write it to a config file (for example, ...
  • Import SQL Data - This script will create tables and load data from an sql file...
  • Improved Strip_Tags() - An improved version of strip_tags()...
  • Include All Files In A Directory - This function will include all files from a specified directory You ...
  • Insert Into Middle Of Text - Insert some text (or image) into the middle of a block of text...
  • Invert Hex Color #2 - Invert a hexadecimal color value Doesn't get any easier than this...
  • Invert Hex Color - Inverts a hexadecimal color value...
  • IRC Bot skeleton code - Simple skeleton code for an IRC bot that connects to an IRC server you specify ...
  • Is email deliverable? - Checks to see if email address is actually deliverable...
  • <<first    <prev    1  2  3  4  (5) 6  7  8  9       next>     last>>