Skip to content

Instantly share code, notes, and snippets.

@uglyeoin
Created January 16, 2022 19:13
Show Gist options
  • Save uglyeoin/a0f83d7b6c41462b330841314819cfce to your computer and use it in GitHub Desktop.
Save uglyeoin/a0f83d7b6c41462b330841314819cfce to your computer and use it in GitHub Desktop.
function debug_to_console($data) {
$output = $data;
if (is_array($output))
$output = implode(',', $output);
echo "<script>console.log('Debug Objects: " . $output . "' );</script>";
}
// Then you can use it like this:
debug_to_console("Test");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment