I am just user print_r, as well as several wrapper functions for storing the various DebugPrint that I inserted into my code, and one on the footer to unload the stack on the page (or in the file).
Now I'm also trying to use XDebug ...: - D
OK, for the record I give my little functions ...
// Primitive debug message storage // $level = "Info", "Warn", "Error", "Title" function DebugPrint($toDump, $level = "Info") { global $debugMode, $debugDump, $debugCount; if ($debugMode != 'N') { $debugDump[$debugCount++] = "<div class='Dbg$level'>" . $toDump . "</div>\n"; } } // Initialize debug information collection $debugMode = 'N'; // N=no, desactivated, P=dump to Web page, F=dump to file $debugSavePath = 'C:\www\App\log_debug.txt'; // If mode F $debugDump = array(); $debugCount = 0; // Primitive debug message dump function DebugDump() { global $debugMode, $debugSavePath, $debugDump, $debugCount; if ($debugMode == 'F') { $fp = fopen($debugSavePath, "a");
The interest is to defer output to the end of the page, avoiding cluttering the real page.
source share