Location: PHPKode > scripts > IMDBSearch > imdbsearch/lib-debug.php
<?
/*	functions for debugging a php application
	Don't modify without written authrization
	Email: hide@address.com
	© Randy Gerritse 2002, All rights reserved.
	================================================================================ */

//function to print the structure of an array
function debugArray($arr) {
	if (is_array($arr)) {
		echo "<br><br><pre><font color=red>";
		print_r($arr);
		echo "</font></pre><br><br>";
	} else
		echo "<br><br><font color=red>not an array!</font><br><br>";
}

//function to echo the content of a string
function debugString($string) {
	if (!empty($string)) {
		echo "<br><br><pre><font color=red>";
		echo $string;
		echo "</font></pre><br><br>";
	} else
		echo "<br><br><font color=red>string is empty!</font><br><br>";
}

//debug the db
function debugDB($ident = "") {
	if ($ident == "")
		$ident = $GLOBALS["connection"]->ident;
	debugString(mysql_error($ident));
}
?>
Return current item: IMDBSearch