/ Published in: PHP
This is the PHP code to debug any variable ..
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** This function is used to debug variables during page execution * @param $what , the variable which need to debug,can be array or single variable * @param $more , to know the method and line number where that variable is used * @param $die , set TRUE if want to stop the page * how to use : debug::watch($postarray,1,1); * @author keshav mohta * @date Aug 12, 2010 */ class debug() { static function watch($what,$more=FALSE,$die=FALSE) { { echo "<br/>METHOD:".$d[1]['class']."::".$d[1]['function']; echo "<br/>LINE:".$d[0]['line']; } echo "<br/>"; { echo "DATA:<pre>"; echo "</pre>"; } else { echo "Data:".$d[0]['args'][0]; } if($die) { echo "<br/>"; } } }