$path = '/var/www/html/uploads'; $contents = \TYPO3\CMS\Core\Utility\GeneralUtility::getAllFilesAndFoldersInPath($path); var_dump($contents);
$path = '/var/www/html/uploads'; $contents = \TYPO3\CMS\Core\Utility\GeneralUtility::getAllFilesAndFoldersInPath($path, '', '', true, '', '', '', 'jpg,png,gif'); var_dump($contents);This code will return an array of only the files in the specified directory '/var/www/html/uploads' that have a .jpg, .png, or .gif file extension. From the examples given, it can be determined that the package library for the GeneralUtility class is "TYPO3\CMS\Core\Utility".