I am currently using scandir to get the contents of an upload folder. Here is my code specifying the directory:
$dir = /var/www/vhosts/mywebsite.com/httpdocs/admin/newsletters/1234-16-10-2013/
$files = scandir($dir);
I then loop through the results like this:
foreach($files as $file) {
echo '<option value="'.$file.'">'.$file.'</option>';
}
The above works fine and populates my select menu correctly. However for some reason the options in the select menu look like this:
<option value=".">.</option>
<option value="..">..</option>
<option selected="selected" value="header.jpg">header.jpg</option>
<option value="sale.jpg">sale.jpg</option>
<option value="show-now.jpg">show-now.jpg</option>
The first 2 options contains full stops. The first has 1 and the second has 2.
Does anyone know why this is? Is it because of the depth of the directory?
Any help would be greatly appreciated!