Return to Snippet

Revision: 59970
at October 12, 2012 21:38 by MikeDevDes


Initial Code
function log( $logthis ){
file_put_contents('logfile.log', date("Y-m-d H:i:s"). " " . $logthis. "
", FILE_APPEND | LOCK_EX);
}

// use 
 for new line on windows, just \n on linux
// PHP_EOL cross platform solution for new line
// // so better to use this

function log( $logthis ){
file_put_contents('logfile.log', date("Y-m-d H:i:s"). " " . $logthis.PHP_EOL, FILE_APPEND | LOCK_EX);
}

Initial URL

                                

Initial Description
Simple logger function

Initial Title
Simple logger function

Initial Tags
log

Initial Language
PHP