Hello,
I have a problem I encountered today.
I want to have 2 certain values in my dropdownbox, one that decides the value and one value that decides the name, but there is a problem, the certain value is not in an array but rather it reas a directory:
[php]if ($handle = opendir(checkSlash($config[‘path_demos’])))
{
while (false !== ($file = readdir($handle)))
{
if ($file != “.” && $file != “…”)
{
if (strpos($file, “.exe”) !== FALSE)
{
$file = substr($file, 0,strrpos($file,’.’));
$demo_count[] = $file;
}
}
}
closedir($handle);
}
[/php]
When that has happened I put it in a array:
[php]$names_dropdown=array(
$demo_count[0] => ‘Easyvoras’,
$demo_count[1] => ‘Easypos’);[/php]
After that I try to make the option:
[php]foreach($demo_count as $demo_option => $names_dropdown)
echo’’.$demo_option.’’;[/php]
But the “$demo_option” always returns as a number not a name!
With kind regards,
Jelle van Lanen