Mine
public php v1 · immutable$my_array = array();$dir = opendir ("/var/www/html/uploads"); while (false !== ($file = readdir($dir))) { if (strpos($file, '.txt',1)||strpos($file, '.txt',1) ) { $my_array[] = $file; echo '<SELECT name=category>'; foreach($my_array as $key => $value) { echo '<OPTION value='.$value.'> '.$value.''; } echo '</select>'; } }