Skip to content

Instantly share code, notes, and snippets.

@janssens
Last active December 7, 2017 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janssens/cf20307ea30d128e3d21a765557d34fc to your computer and use it in GitHub Desktop.
Save janssens/cf20307ea30d128e3d21a765557d34fc to your computer and use it in GitHub Desktop.
ploplog, simple php log function
<?php
function plopLog($var,$file){
ob_start();
var_dump($var);
$output = ob_get_clean();
$outputFile = dirname(__FILE__).DS.$file;
$fileHandle = fopen($outputFile, 'a') or die("File creation error :".$outputFile);
fwrite($fileHandle, $output);
fclose($fileHandle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment