I want to accomplish :to open a sub directory from "/home/www/htdocs/icm/sessions" -> there are sub folders in sessions and in those folders there are "chromatin.html" files which i want them to populate in a dropdown box.
I am not able to open the files as i intended to, Please let me know where I am doing it wrong
Code: Select all
<?php
echo "<select name='files' , fixedscript, ID='file_selector'>";
$files = scandir("/home/www/abc/def/seq");
foreach ($files as $file){
$ext = substr($file, -4);
if(strtolower($ext) == 'xyz.html')
{
$file = substr($file, 0, strrpos($file, '.'));
echo '<option value="' . $file . 'xyz.html">' . $file . '</option>';
}
}
echo "</select>";
?>