Welcome Guest, Not a member yet? Register   Sign In
none recursive get_filenames
#1

[eluser]koorb[/eluser]
Is there anyway to use get_filenames without it being recursive? I only want the files listed in the directory is specify not in child directories!
#2

[eluser]Pascal Kriete[/eluser]
I don't think there is. You could use the directory helper's directory_map function instead. That would leave you with files and directories, so you would have to filter out the directories:
Code:
$this->load->helper('directory');

$dir = './downloads/';
$map = directory_map($dir, TRUE);

foreach($map as $file)
{
    if( ! @is_dir($dir.$file)
    {
        echo $file;
    }
}

Hope that helps.
#3

[eluser]koorb[/eluser]
fab, thank you Smile




Theme © iAndrew 2016 - Forum software by © MyBB