Helper Functions

MySQL Backup Script

Here is what I use to make a backup library of MySQL daily that will keep backups for 30 days.

SWFUpload with cPanel and mod_security

I searched long and hard to find what was causing swfupload to fail on my cPanel, but work on my test environment so I thought I better save the result incase I need it again.

Apache Expires Headers with mod_expires

Quick example of how to set default expires headers.

2-Way MySQL Replication

Some notes and commands I want to keep handy the next time I setup MySQL replication.

Inner Resize Browser Window

This JavaScript function will resize the inside of a browser window to the dimensions provided.

Deep Array Reverse

Recursively reverses a multi-depth array.

Remove Array Nulls

Recursively removes array keys with null values.

Deep In Array

Function similar to in_array() but it recursively searches a multi-depth array.

URL Reader

This function will download the contents of any URL and return it as a string that you can save to a file or database.

It will use curl if it is installed. Otherwise it will use fopen/fread.