method mscan documentation in bbn\File\Dir
Returns an array of indexed arrays with the 'name' of the file/folder contained in the given directory, the 'mtime', and the 'date' of creation the file/folder.
Example
\bbn\X::dump(\bbn\File\Dir::mscan("/home/data/test"));
/* (array)
[
[
"name" => "/home/data/test/Folder",
"mtime" => 1480422173,
"date" => "2016-11-29 13:22:53",
],
[
"name" => "/home/data/test/Folder_test",
"mtime" => 1480422173,
"date" => "2016-11-29 13:22:53",
],
[
"name" => "/home/data/test/Folder_test/image.png",
"mtime" => 1480418947,
"date" => "2016-11-29 12:29:07",
]
]
\bbn\X::dump(\bbn\File\Dir::mscan("/home/data/test", "dir"));
/* (array)
[
[
"name" => "/home/data/test/Folder",
"mtime" => 1480422173,
"date" => "2016-11-29 13:22:53",
],
[
"name" => "/home/data/test/Folder_test",
"mtime" => 1480422173,
"date" => "2016-11-29 13:22:53",
]
]
\bbn\X::dump(\bbn\File\Dir::mscan("/home/data/test", "file"));
/* (array)
[
[
"name" => "/home/data/test/Folder_test/image.png",
"mtime" => 1480418947,
"date" => "2016-11-29 12:29:07",
]
]
\bbn\X::dump(\bbn\File\Dir::mscan("/home/data/test", "file",1));
/* (array)
[
[
"name" => "/home/data/test/Folder_test/image.png",
"mtime" => 1480418947,
"date" => "2016-11-29 12:29:07",
],
[
"name" => "/home/data/test/Folder/.doc.pdf",
"mtime" => 1480418947,
"date" => "2016-11-29 12:29:07",
]
]
function(string $dir, string $type = NULL, $hidden = false)
{
$res = [];
if ( $all = self::scan($dir, $type, $hidden) ){
foreach ($all as $a ){
$t = filemtime($a);
$res[] = ['name' => $a, 'mtime' => $t, 'date' => date('Y-m-d H:i:s', $t)];
}
}
return $res;
}
Returns an array of indexed arrays with the 'name' of the file/folder contained in the given directory, the 'mtime', and the 'date' of creation the file/folder. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions