Storing key values in an array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am using an array to populate a drop-down and I would like to have the same value in the key as the value. Using the following, the key is 0,1,2,3...etc. How can I correct that?

    $file_list = array();
    $dir = opendir($doc_dir);
    while (false !== ($file = readdir($dir))) {
      if (($file != ".") && ($file != ".."))
        $file_list[$file] = $file;  <---------------<<<<<
    }

Todd

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux