Here's a quick debugging technique to capture your output and email it to yourself. This can be useful when you cannot send your debug output to the browser.
<?php
// start output buffer
ob_start();
// display the contents of your variable
print_r($YOURVARIABLE);
// get the contents of the output buffer
$ob = ob_get_contents();
// stop output buffer
ob_end_clean();
// mail contents of output buffer to yourself
mail('YOUREMAIL','Output Buffer Contents',$ob);
?>









