This function will extract the file extension from a string that represents a filename. It retrieves the characters after the last dot and returns them as a new string.
Show A 0-5 Rate As Stars
Show a 0 to 5 floating point rating in graphic stars using a PHP function. You can specify which direction to align the graphic stars (left or right)
Stripping string of URL unsafe characters
A function that will strip all the unsafe characters from a string in order to make it valid for URLs. This can be especially useful when you create your own URLs dynamically using mod_rewrite.
URL Reconstruction Using PHP
Reconstruct an URL in PHP by concatenating the domain-name, path and query string from three different variables.
Convert JPEG Image To Grayscale
Convert a JPEG to a grayscale JPEG using PHP and the IMG_FILTER_GRAYSCALE type of filter.
Generate Gradient Within Hex Range In PHP
A function that generates an array of hex colors that forms a gradient, starting from a hex color and ending with another hex color. The number of gradient steps can also be defined.
Show Page Load Time In PHP
Using a line of code at the beginning of the file and a function call at the end, you can count the number of milliseconds it took PHP to load the page.
Emulate register_globals Flag As On
How to emulate the insecure, deprecated register_globals flag so that you can access GET and POST keys as PHP variables.
Prevent Duplicate Form Submission
Learn how to use PHP sessions to prevent duplicate form submission or re-submission.
Basic Hit Counter In PHP
A very basic hit counter in PHP; it uses a text file to store the number of hits and displays the number of current hits.