Last active
September 14, 2017 10:51
-
-
Save Pum-purum/d616613f3f360e5de1bf3a245e9226a4 to your computer and use it in GitHub Desktop.
Битрикс дебаг / Bitrix debug
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
/* | |
Выводят переменную в консоль браузера. Применяются для отладки | |
*/ | |
function vpr ($var, $label = '') | |
{ | |
$str = json_encode(print_r ($var, true)); | |
echo "<script>console.group('".$label."');console.log('".$str."');console.groupEnd();</script>"; | |
} | |
function vd ($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