I'm using scandir and a foreach loop to display a list of files in a directory to the user. My code is below:
$dir = scandir('/user1/caravans/public_html/wordpress/wp-content/uploads/wpallimport/files');
foreach($dir as $directory)
{
echo "<br/><input type='checkbox' name=\"File[]\" value='$directory'/>$directory<br>";
}
The problem is the script also echos a "." and a ".." (without the speech marks), is there an elegant way to remove these? Short or a regular expression. Thanks