Skip to content

Instantly share code, notes, and snippets.

@asakapab0i
Created April 22, 2014 09:38
Show Gist options
  • Save asakapab0i/11172076 to your computer and use it in GitHub Desktop.
Save asakapab0i/11172076 to your computer and use it in GitHub Desktop.
read diles in directory
<?php
if ($handle = opendir('directory')) {
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
if($entry == '..' || $entry == '.'){
continue;
}
$lists[] = $entry;
}
foreach($lists as $listKey => $listName){
echo basename($listName, '.pdf')."\n";
}
closedir($handle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment