public static function debugRows($rows, $header = '', $returnHTML = FALSE) {
		if (is_array($rows)) {
			$firstEl = reset($rows);
			if (is_array($firstEl)) {
				$headerColumns = array_keys($firstEl);
				$tRows = array();

					// Header:
				$tRows[] = '<tr><td colspan="' . count($headerColumns) .
						   '" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' .
						   htmlspecialchars($header) . '</strong></td></tr>';
				$tCells = array();
				foreach ($headerColumns as $key) {
					$tCells[] = '
							<td><font face="Verdana,Arial" size="1"><strong>' . htmlspecialchars($key) . '</strong></font></td>';
				}
				$tRows[] = '
						<tr>' . implode('', $tCells) . '
						</tr>';

					// Rows:
				foreach ($rows as $singleRow) {
					$tCells = array();
					foreach ($headerColumns as $key) {
						$tCells[] = '
							<td><font face="Verdana,Arial" size="1">' .
									(is_array($singleRow[$key]) ? self::debugRows($singleRow[$key], '', TRUE) : htmlspecialchars($singleRow[$key])) .
									'</font></td>';
					}
					$tRows[] = '
						<tr>' . implode('', $tCells) . '
						</tr>';
				}

				$table = '
					<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">' . implode('', $tRows) . '
					</table>';
				if ($returnHTML) {
					return $table;
				}
				else
				{
					echo $table;
				}
			} else
			{
				debug('Empty array of rows', $header);
			}
		} else {
			debug('No array of rows', $header);
		}
	}
public static function debugRows($rows, $header = '', $returnHTML = FALSE) {
		if (is_array($rows)) {
			$firstEl = reset($rows);
			if (is_array($firstEl)) {
				$headerColumns = array_keys($firstEl);
				$tRows = array();

					// Header:
				$tRows[] = '<tr><td colspan="' . count($headerColumns) .
						   '" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' .
						   htmlspecialchars($header) . '</strong></td></tr>';
				$tCells = array();
				foreach ($headerColumns as $key) {
					$tCells[] = '
							<td><font face="Verdana,Arial" size="1"><strong>' . htmlspecialchars($key) . '</strong></font></td>';
				}
				$tRows[] = '
						<tr>' . implode('', $tCells) . '
						</tr>';

					// Rows:
				foreach ($rows as $singleRow) {
					$tCells = array();
					foreach ($headerColumns as $key) {
						$tCells[] = '
							<td><font face="Verdana,Arial" size="1">' .
									(is_array($singleRow[$key]) ? self::debugRows($singleRow[$key], '', TRUE) : htmlspecialchars($singleRow[$key])) .
									'</font></td>';
					}
					$tRows[] = '
						<tr>' . implode('', $tCells) . '
						</tr>';
				}

				$table = '
					<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">' . implode('', $tRows) . '
					</table>';
				if ($returnHTML) {
					return $table;
				}
				else
				{
					echo $table;
				}
			} else
			{
				debug('Empty array of rows', $header);
			}
		} else {
			debug('No array of rows', $header);
		}
	}
public static function debugRows ( $ rows , $ header = '' , $ returnHTML = FALSE ) { if ( is_array ( $ rows ) ) { $ firstEl = reset ( $ rows ) ; if ( is_array ( $ firstEl ) ) { $ headerColumns = array_keys ( $ firstEl ) ; $ tRows = array ( ) ; // Header: $ tRows [ ] = '<tr><td colspan="' . count ( $ headerColumns ) . '" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' . htmlspecialchars ( $ header ) . '</strong></td></tr>' ; $ tCells = array ( ) ; foreach ( $ headerColumns as $ key ) { $ tCells [ ] = '
							<td><font face="Verdana,Arial" size="1"><strong>' . htmlspecialchars ( $ key ) . '</strong></font></td>' ; } $ tRows [ ] = '
						<tr>' . implode ( '' , $ tCells ) . '
						</tr>' ; // Rows: foreach ( $ rows as $ singleRow ) { $ tCells = array ( ) ; foreach ( $ headerColumns as $ key ) { $ tCells [ ] = '
							<td><font face="Verdana,Arial" size="1">' . ( is_array ( $ singleRow [ $ key ] ) ? self :: debugRows ( $ singleRow [ $ key ] , '' , TRUE ) : htmlspecialchars ( $ singleRow [ $ key ] ) ) . '</font></td>' ; } $ tRows [ ] = '
						<tr>' . implode ( '' , $ tCells ) . '
						</tr>' ; } $ table = '
					<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">' . implode ( '' , $ tRows ) . '
					</table>' ; if ( $ returnHTML ) { return $ table ; } else { echo $ table ; } } else { debug ( 'Empty array of rows' , $ header ) ; } } else { debug ( 'No array of rows' , $ header ) ; } }
Displays an array as rows in a table. Useful to debug output like an array of database records.

@param	mixed		Array of arrays with similar keys
@param	string		Table header
@param	boolean		If TRUE, will return content instead of echo'ing out.
@return	void		Outputs to browser.
Displays an array as rows in a table . Useful to debug output like an array of database records .