mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 23:58:54 +01:00
Add printing of var type in print_r()
This commit is contained in:
parent
fec8b59825
commit
090b9022b6
@ -271,22 +271,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
function print_r($array)
|
||||
function print_r($array,$recursed=False)
|
||||
{
|
||||
if(gettype($array)=="array")
|
||||
if(is_array($array) || is_object($array))
|
||||
{
|
||||
echo '<ul>';
|
||||
if(!$recursed)
|
||||
{
|
||||
echo '<p>';
|
||||
}
|
||||
echo ucfirst(gettype($array)) . '(<ul>';
|
||||
|
||||
while(list($index, $subarray) = each($array) )
|
||||
{
|
||||
echo '<li>'.$index.' <code>=></code>';
|
||||
print_r($subarray);
|
||||
echo '<li>'.$index.' <code>=> </code>';
|
||||
print_r($subarray,True);
|
||||
echo '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo '</ul>)';
|
||||
}
|
||||
elseif(is_string($array))
|
||||
{
|
||||
echo ucfirst(gettype($array)) . '("' . $array . '")';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $array;
|
||||
echo gettype($array) . '(' . $array . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user