functions : Added varDump function and use it in LSdebug function

This commit is contained in:
Benjamin Renard 2009-11-11 19:53:49 +00:00
parent 9ddb6c17e2
commit 791e20be74

View file

@ -208,13 +208,18 @@ function return_data($data) {
return $data;
}
function varDump($data) {
ob_start();
var_dump($data);
$data=ob_get_contents();
ob_end_clean();
return $data;
}
$GLOBALS['LSdebug_fields']=array();
function LSdebug($data,$dump=false) {
if ($dump) {
ob_start();
var_dump($data);
$GLOBALS['LSdebug_fields'][]=ob_get_contents();
ob_end_clean();
$GLOBALS['LSdebug_fields'][]=varDump($data);
}
else {
if (is_array($data)||is_object($data)) {