function _Logger($str) { $str = (string) $str; // casting for luck if(strlen($str) > 0) { $str = "\nLog @ ". strftime('%c')."\n".$str."\n"; $logdir = '/path/to/_tmp_log/'; if(!is_dir($logdir)) { mkdir($logdir); } $logfile = $logdir.'fudmaildump.txt'; $fh = fopen($logfile, 'a'); fwrite($fh, $str); fclose($fh); } }
$msg_post->body = fud_wordwrap($msg_post->body);
function fud_wordwrap(&$data) { ... }