Created
December 9, 2009 01:28
-
-
Save benmills/252175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $dir = "."; | |
function contents($dir, $path = null) { | |
if (is_dir($dir)) { | |
if ($dh = opendir($dir)) { | |
$odd = false; | |
while (($file = readdir($dh)) !== false) { | |
if ($file != "." && $file != ".." && $file != "index.php") { | |
// Do something with this file | |
} | |
} | |
closedir($dh); | |
} | |
} | |
} | |
// Open a known directory, and proceed to read its contents | |
contents($dir); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment