Good day. There is a list (select). The script should parse the names of the php files in the directory, then display them in a drop-down list. And it outputs, but it is crooked. It turns out that the name of each new file is placed in a separate drop-down list, but it is necessary, that in one.
$dir = '../'; $f = scandir($dir); foreach ($f as $file){ if(preg_match('/\.(php)/', $file)){ echo '<select><option>'.$file.'</option></select>'; echo'<br>'; } } what am I doing wrong ?