Skip to content

Instantly share code, notes, and snippets.

@marceloxp
Created June 7, 2013 20:54
Show Gist options
  • Save marceloxp/5732357 to your computer and use it in GitHub Desktop.
Save marceloxp/5732357 to your computer and use it in GitHub Desktop.
Save log to disk
function Log($texto)
{
$tw = $texto;
if (is_array($texto))
{
ob_start();
print_r($texto);
$tw = ob_get_contents();
ob_end_clean();
}
$fp = fopen("log.txt", "w");
fwrite($fp, date("d/m/y d:H:is") . " " . $texto . "\n");
fclose($fp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment