How can PHP 4.x.x users achieve the same functionality as PHP 5.x users when it comes to filtering files in a directory based on specific criteria?

PHP 4.x.x users can achieve the same functionality as PHP 5.x users by using the `glob()` function to filter files in a directory based on specific criteria. This function allows users to specify a search pattern to match files and directories. By using `glob()`, PHP 4.x.x users can easily filter files based on file extensions, prefixes, or any other criteria they need.

$files = glob('/path/to/directory/*.txt');
foreach ($files as $file) {
    echo $file . "\n";
}