Last active
May 21, 2019 17:00
-
-
Save madcatgith/11b8bedabcc9ccb717aea0d27c332908 to your computer and use it in GitHub Desktop.
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
/** | |
*Вывод данных в отладочную консоль javascript для Bitrix с исправленным выводом киррилицы в качестве ключа массива | |
**/ | |
function console_log($data){ | |
global $USER; | |
if ($USER->IsAdmin()) { | |
$json = json_encode(unserialize(str_replace(array('NAN;','INF;'),'0;',serialize($data)))); | |
echo '<script>'; | |
echo 'console.log("---------CONSOLE DEBUG-------");'; | |
echo 'console.log(' . $json . ');'; | |
echo 'console.log("---------END DEBUG-------");'; | |
echo '</script>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment