$code = WH_GetCode($file);
                if (in_array($code, $wh_phonemes)) {
                    echo "<img src=\"" . WH_IMG_DIR . "{$file}\" title=\"{$code} [" . array_search($code, $wh_phonemes) . "]\">\n";
                }
            } else {
                if ($table == "Aa") {
                    $code = WH_GetCode($file);
                    if (substr($code, 0, 2) == $table && ctype_digit($code[2])) {
                        if (in_array($code, $wh_phonemes)) {
                            echo "<img src=\"" . WH_IMG_DIR . "{$file}\" title=\"{$code} [" . array_search($code, $wh_phonemes) . "]\">\n";
                        } else {
                            echo "<img src=\"" . WH_IMG_DIR . "{$file}\" title=\"{$code}\">\n";
                        }
                    }
                } else {
                    $code = WH_GetCode($file);
                    if ($code[0] == $table && ctype_digit($code[1])) {
                        if (in_array($code, $wh_phonemes)) {
                            echo "<img src=\"" . WH_IMG_DIR . "{$file}\" title=\"{$code} [" . array_search($code, $wh_phonemes) . "]\">\n";
                        } else {
                            echo "<img src=\"" . WH_IMG_DIR . "{$file}\" title=\"{$code}\">\n";
                        }
                    }
                }
            }
        }
    }
    closedir($dh);
}
?>
</big>

    <br><br>Parsing hieroglyph files and creating tables...<br><br>

    <?php 
$wh_prefabs = "\$wh_prefabs = array(\n";
$wh_files = "\$wh_files   = array(\n";
$img_dir = dirname(__FILE__) . '/img/';
if (is_dir($img_dir)) {
    if ($dh = opendir($img_dir)) {
        while (($file = readdir($dh)) !== false) {
            if (stristr($file, WH_IMG_EXT)) {
                list($width, $height, $type, $attr) = getimagesize($img_dir . $file);
                $wh_files .= "  \"" . WH_GetCode($file) . "\" => array( {$width}, {$height} ),\n";
                if (strchr($file, '&')) {
                    $wh_prefabs .= "  \"" . WH_GetCode($file) . "\",\n";
                }
            }
        }
        closedir($dh);
    }
}
$wh_prefabs .= ");";
$wh_files .= ");";
echo "<pre>{$wh_prefabs}<br><br>";
echo "{$wh_files}<br><br></pre>";
$file = fopen("wh_list.php", "w+");
fwrite($file, "<?php\n\n");
fwrite($file, "// File created by wh_generate.php version " . WH_VER_MAJ . "." . WH_VER_MED . "." . WH_VER_MIN . "\n");
fwrite($file, "// " . date("Y/m/d at H:i") . "\n\n");
fwrite($file, "global \$wh_prefabs, \$wh_files;\n\n");