Skip to content

Instantly share code, notes, and snippets.

@wallacemaxters
Last active November 6, 2015 13:06
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 wallacemaxters/73886a39b3f391a71055 to your computer and use it in GitHub Desktop.
Save wallacemaxters/73886a39b3f391a71055 to your computer and use it in GitHub Desktop.
An easy way to debug PHP in console of browser
<?php
function console_log()
{
foreach (func_get_args() as $mixed) {
printf('<script>console.log(%s)</script>', json_encode($mixed));
}
}
@wallacemaxters
Copy link
Author

// index.php?name=Wallace
console_log($_GET);

Prints in browser console

{name: "Wallace"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment