What are some potential differences in behavior between a Linux webhost and a Windows test server when implementing directory listings in PHP?

When implementing directory listings in PHP on a Linux webhost, you may need to ensure that the server's configuration allows for directory browsing. On the other hand, Windows test servers may have different default settings that need to be adjusted to enable directory listings in PHP.

// Enable directory listings in PHP on a Linux webhost
if (is_dir($dir)) {
    if ($handle = opendir($dir)) {
        while (($file = readdir($handle)) !== false) {
            echo "$file\n";
        }
        closedir($handle);
    }
}