Created
August 22, 2015 21:28
-
-
Save iredun/f24320e7222206107ec4 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
<? | |
function pre($array=false,$description=false,$debug_print_trace=false) { | |
$debug_trace = debug_backtrace(); | |
if($debug_print_trace){ | |
foreach(debug_backtrace() as $k=>$v){ | |
if($v['function'] == "include" || $v['function'] == "include_once" || $v['function'] == "require_once" || $v['function'] == "require"){ | |
$backtracel .= "#".$k." ".$v['function']."(".$v['args'][0].") called at [".$v['file'].":".$v['line']."]<br />"; | |
}else{ | |
$backtracel .= "#".$k." ".$v['function']."() called at [".$v['file'].":".$v['line']."]<br />"; | |
} | |
} | |
echo "<br /><b>".$backtracel."</b><br />"; | |
} | |
else { | |
print( "<br /><b>".$debug_trace[0]["file"].": ".$debug_trace[0]["line"]."</b><br />"); | |
} | |
if($description) | |
echo "<b>".$description."</b><br />"; | |
echo "<pre>"; | |
print_r($array); | |
echo "</pre>"; | |
return true; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment