Skip to content

Instantly share code, notes, and snippets.

@jhoff
Created December 16, 2012 23:04
Show Gist options
  • Save jhoff/4313993 to your computer and use it in GitHub Desktop.
Save jhoff/4313993 to your computer and use it in GitHub Desktop.
PHP js_log - object inspector
function js_log() {
foreach(func_get_args() as $obj) {
if( gettype($obj) != 'resource' ) {
echo "<script>console.log(" . json_encode($obj) . ");</script>";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment