| Code: |
function getFlagList($dirName, $Country){
$d = dir($dirName);
while($entry = $d->read()){
if($entry != "." && $entry != ".." && $entry != "CVS"){
$short_entry = eregi_replace(".gif", "", $entry);
$short_entry = eregi_replace("_", " ", $short_entry);$arrCountry[$short_entry] = $entry; } asort($arrCountry); foreach ($arrCountry as $short_entry => $entry)
{
$html .= "<option value=\"" . $entry . "\"";
if($Country == $entry){
$html .= " selected=\"selected\"";
}
$html .= ">" . $short_entry . "</option>\n";
}
}
$d->close();
return $html;
}
|
This is what I have in my functions.php
Showing duplicate entries in the list...???