Created
July 17, 2013 17:43
-
-
Save emersonbroga/6022740 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function log($text) | |
{ | |
if(is_array($text) || is_object($text)){ | |
$text = http_build_query($text); | |
} | |
// open log file | |
$filename = "mylog.txt"; | |
$fh = fopen($filename, "a") or die("Could not open log file."); | |
fwrite($fh, date("d-m-Y, H:i")." - $text\n") or die("Could not write file!"); | |
fclose($fh); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment