note 12180 deleted from function.var-dump by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 23:58:47 +0000 |
| Subject: | note 12180 deleted from function.var-dump by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22402@lists.php.net to get a copy of this message | ||
A combination of var_dump() and print_r(),
Call this function like this:
If you want to use the print_r()
debug($mixed_variable,__LINE__,__FILE__);
If you want to use the var_dump()
debug(,$mixed_variable,__LINE__,__FILE__,0);
function debug($val,$line='', $file = '',$type = 1){
$CRLF = "\r\n";
echo $CRLF.'<TABLE WIDTH="100%" BGCOLOR="ORANGE">';
echo $CRLF.'<TR><TD HEIGHT="15" NOWRAP><H3>****** Line:
'.$line.' in: '.$file.' ******</H3></TD></TR>';
echo $CRLF.'<TR><TD>';
print $CRLF.'<pre><FONT COLOR = "NAVY">';
if($type){
if(is_array($val) || is_object($val)){
print_r($val);
}else{
print $CRLF.$val;
}
}else{
var_dump($val);
}
print $CRLF.'</FONT></pre>';
echo $CRLF.'</TD></TR>';
print $CRLF.'</TABLE>';
print $CRLF.'<br><br>'.$CRLF;
}//END function debug()
//babak@jay.net