What are alternative methods to readdir() for reading files from a directory in PHP?

When working with directories in PHP, an alternative method to `readdir()` is to use the `glob()` function. This function allows you to search for files using wildcard patterns and returns an array of file paths matching the pattern. This can be useful for reading files from a directory without having to iterate through each file manually.

// Using glob() to read files from a directory
$files = glob('/path/to/directory/*');

foreach ($files as $file) {
    echo $file . "\n";
}