Archives for: "April 2009"
Gradient Generator Notes
Apr 15th
Value
The value of this utility is in its simplicity. Image, photo, and graphical editors are very action-intensive. This tool allows a selection of a single color, the width/height, and then it creates all four gradients. This is a very fast way t… more »
Optional Parameters - Extending Existing Functions
Apr 14th
Both PHP and javascript allow optional parameters and variable arguments.
PHP
func_get_args() - allows you to get the arguments for a function. Great if you need a variable number of arguments, perhaps for something like sprintf. http://us3.php… more »
Multi-Dimensional Array Sorts for PHP
Apr 2nd
To sort a multi-dimensional array in PHP, you can use usort, like so:
usort($aArray,"cmp_func");
function cmp_func($a,$b)
{
return strcasecmp($a['x'],$b['x']);
} more »