$dir = '/path/to/directory/'; $fileList = CFile::GetList(array(), array('PATH' => $dir), false); while ($file = $fileList->Fetch()) { echo $file['NAME'] . "
"; }
$dir = '/path/to/directory/'; $fileList = CFile::GetList(array(), array('PATH' => $dir, 'EXTENSION' => 'jpg'), false); while ($file = $fileList->Fetch()) { echo $file['NAME'] . "
"; }
$dir = '/path/to/directory/'; $date = '2021-01-01 00:00:00'; $fileList = CFile::GetList(array(), array('PATH' => $dir, 'TIMESTAMP_X_1' => $date), false); while ($file = $fileList->Fetch()) { echo $file['NAME'] . "This example returns only files that were modified after January 1, 2021 by using the `'TIMESTAMP_X_1' => $date` parameter in the second argument. CFile GetList function is part of the Bitrix Framework PHP library, specifically the `CFile` class.
"; }