I've posted this function before. It's incredibly useful:
function printr($var, $desc = '')
{
echo "<pre>";
if ($desc !== '') echo "{$desc}: ";
print_r($var);
echo "</pre>\n";
}
This lets you add an optional description to the variable you're printing out. Here are some examples:
$foo = "Some variable.";
printr($_POST, '$_POST before form processing');
if (isset($_POST['username']))
{
$_POST['username'] = strtolower($_POST['username']);
}
printr($_POST, '$_POST after form processing');
printr($foo); // description parameter is optional.
Take care,
Nik
http://www.bigaction.org/