Here's something I made to show where there were arraykeys missing. It's in atable and it has a nice style attached. Works best in gecko/opera
<?php
$f = $_GET['f'];
if ( empty( $f ) || strpos( $f, '/' ) > 0 || !file_exists( "$f.inc.php" ) ) {
unset ($output);
$output = "\t<p>Nope.</p>\n";
} else {
require "english.inc.php";
$english_translation = $_lang;
unset ($_lang);
require "$f.inc.php";
# html on screen
function htmlspecialchars_array($arr = array()) {
$rs = array();
while(list($key,$val) = each($arr)) {
if(is_array($val)) {
$rs[$key] = htmlspecialchars_array($val);
}
else {
$rs[$key] = htmlspecialchars($val, ENT_QUOTES);
}
}
return $rs;
}
$english_translation = htmlspecialchars_array($english_translation);
$_lang = htmlspecialchars_array($_lang);
# generate the output
$output = "\t<table class=\"mainTable\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>language key</th>\n\t\t\t\t<th>english.inc.php</th>\n\t\t\t\t<th>$f.inc.php</th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n";
$num = 1;
foreach ( $english_translation as $key => $value) {
$_lang[$key] = isset($_lang[$key]) ? $_lang[$key] : "<span class=\"notSet\">\$_lang['$key'] not set!</span>";
$output .= "\t\t\t<tr class=\"row$num\">\n\t\t\t\t<th width=\"1\">$key</th>\n\t\t\t\t<td>$value</td>\n\t\t\t\t<td>".$_lang[$key]."</td>\n\t\t\t</tr>\n";
$num = $num == 2 ? 1 : 2;
}
$output .= "\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr>\n\t\t\t\t<th>language key</th>\n\t\t\t\t<th>english</th>\n\t\t\t\t<th>$f</th>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n";
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Values you need to add in <?=$f.".inc.php";?></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css">
* {
font-size: 11px;
margin: 0;
padding: 0;
border: 0;
}
body {
padding: 1em;
background: #fff;
font-family: verdana, tahoma, sans-serif;
}
table {
border:1px solid #eee;
padding:1px;
background:#fcfcfc;
width:100%;
}
table thead {
padding:0px;
margin:0px
}
table thead th {
margin:0px 1px;
background:#eee;
padding:.5em
}
table tr:hover {
background: #f6f6f6;
}
table th, table td {
padding:.3em;
}
table tbody td, table tbody th {
border-top:1px solid #eee;
}
table th {
text-align:right;
margin: 0 40% 0 0;
}
.notSet {
color: #C00;
font-weight: bold;
}
</style>
</head>
<body>
<?php echo $output; ?>
</body>
</html>