$dir2="/home/user/www/somesite.com/photos/".$folder_name."/";}
$massiv2 = glob($dir2."*");
php > var_dump(glob('*'));
array(5) {
[0] =>
string(1) "a"
[1] =>
string(1) "b"
[2] =>
string(1) "c"
[3] =>
string(5) "hello"
[4] =>
string(4) "test"
}
php > var_dump(preg_grep('/[abcd]/', glob('*'), PREG_GREP_INVERT));
array(2) {
[3] =>
string(5) "hello"
[4] =>
string(4) "test"
}
php >
$iterator = new RegexIterator(
new DirectoryIterator(
$dir2,
FilesystemIterator::KEY_AS_PATHNAME
| FilesystemIterator::CURRENT_AS_FILEINFO
| FilesystemIterator::SKIP_DOTS
),
'~[^a-d]~'
);
foreach ($iterator as $file_info) {
$filename = $file_info->getBasename();
};