Created
June 12, 2014 10:45
-
-
Save jimboroberts/931a4a7d590819ee5ef4 to your computer and use it in GitHub Desktop.
Php function to debug to console
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
//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