Last active
November 10, 2017 09:20
-
-
Save sidor1989/b9f3759da9a42764042e8c0be3b44738 to your computer and use it in GitHub Desktop.
dumpArrayBitrix
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 PR($var, $all = false, $die = false) | |
{ | |
global $USER; | |
if(($USER->GetID() == 1) || ($all == true)) | |
{ | |
$bt = debug_backtrace(); | |
$bt = $bt[0]; | |
$dRoot = $_SERVER["DOCUMENT_ROOT"]; | |
$dRoot = str_replace("/","\\",$dRoot); | |
$bt["file"] = str_replace($dRoot,"",$bt["file"]); | |
$dRoot = str_replace("\\","/",$dRoot); | |
$bt["file"] = str_replace($dRoot,"",$bt["file"]); | |
?> | |
<div style='font-size:9pt; color:#000; background:#fff; border:1px dashed #000;'> | |
<div style='padding:3px 5px; background:#99CCFF; font-weight:bold;'>File: <?=$bt["file"]?> [<?=$bt["line"]?>]</div> | |
<pre style='padding:10px;'><?print_r($var)?></pre> | |
</div> | |
<? | |
} | |
if($die) | |
{ | |
die; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment