Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.