Skip to content

Instantly share code, notes, and snippets.

@jimboroberts
Created June 12, 2014 10:45
Show Gist options
  • Save jimboroberts/931a4a7d590819ee5ef4 to your computer and use it in GitHub Desktop.
Save jimboroberts/931a4a7d590819ee5ef4 to your computer and use it in GitHub Desktop.
Php function to debug to console
//Simple helper to debug to the console
function debug_to_console($data) {
if ( is_array( $data ) )
$output = "<script>console.log( 'PaulBot Debug: " . implode( ',', $data) . "' );</script>";
else
$output = "<script>console.log( 'PaulBot Objects: " . $data . "' );</script>";
echo $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment