Home >> Snippet List
PHP Code Snippets
Truncate URLs for clean appearance. - Makes nicer looking URLs quickly and easily Prevent stretching a ... Unique Array function - Similar to array_unique(), but implemented manually... Unique IP-icture - Creates a picture based on your IP address
Is it useful? No!
Is it cool? Yes!... Universal parameter reading - This simple yet practical function will read in your scripts' parameters ... UNIX Timestamp conversion - Examples of converting UNIX timestamps to more useful formats... Unset unkown array element - Given the array "1,2,3,4",
let's say you want to delete the "3" You know... Update MySQL Table Using An Array - Iterate over an array and update a mySQL table... Use htpasswd file with PHPscripts - This is a way to use an existing htpasswd file with your PHP-based ... Use SendMail - Talking to the mail program is like writing to a file (Perl programmers will be familiar... Validate credit card numbers - A set of functions to check the validity of a credit card number
($nu... Validate email address #1 - Validates an email address format... Validate email address #2 - Validates an email address format... Validate email address #3 - This function validates an email address, returning an integer
depending o... Vulnerability Tester - A source code tester This searches through code (PHP files in this case) and fin... WebServer Spy - WebServerSpy checks which kind of Webserver is running, Apache, Netscape
, Fasttrack, ... Weighted Random Choice - Random selection with a weighted bias... What Season Is It? - Simple PHP script tells you what season it is... Write text onto an image - Example of how to superimpose text onto an image Great for watermarking or f... Write to File example - A quick example of writing to a flat file... XSS Sanitizer Function - Data sanitizing function for cleaning out malicious code or characters from in... Yahoo Online Status - Checks status of a Yahoo user by User ID...