This might not even warrant posting here, but I"m enjoying it and thought I would share.
//For Testing
function write_to_file($message){
$handle = fopen("/path/to/logs/a_log_file.php", "a+");
if (is_array($message)):
fwrite($handle, "\nMessage is array.\t ");
fclose($handle);
file_put_contents('/path/to/logs/a_log_file.php', print_r($message, true),
FILE_APPEND | LOCK_EX);
else:
fwrite($handle, "\nMessage:\t " . $message);
fclose($handle);
endif;
}
Haven't actually tested with multidimensional array yet and might be a good opportunity for some recursion.
Comments, suggestions and criticism are of course welcome.