$path = "path/to/directory"; $filesAndFolders = t3lib_div::getAllFilesAndFoldersInPath($path); foreach ($filesAndFolders as $fileOrFolder) { echo $fileOrFolder . "\n"; }In this example, we first specify the path of the directory we want to get the list of files and folders from. Then, we use the `t3lib_div::getAllFilesAndFoldersInPath()` function to get the names of all files and folders in that directory. Finally, we loop through each file or folder name and print it to the console. Overall, this function is quite versatile and can be used for a variety of use cases. It's particularly useful if you need to iterate over all the files and folders in a directory and perform some action on them.