Created
August 15, 2019 12:02
-
-
Save shzk/2e96db4f90fe747244f998a8bdf3617d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function cl_print_r ($var, $label = '') | |
{ | |
$str = json_encode(print_r ($var, true)); | |
echo "<script>console.group('".$label."');console.log('".$str."');console.groupEnd();</script>"; | |
} | |
function cl_var_dump ($var, $label = '') | |
{ | |
ob_start(); | |
var_dump($var); | |
$result = json_encode(ob_get_clean()); | |
echo "<script>console.group('".$label."');console.log('".$result."');console.groupEnd();</script>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment