Monday, April 24, 2017

List files in a directory

<?php
$dir    = '../../../kindle/K';
$files = scandir($dir);
$i = 1;
foreach ($files as $key=>$value) {
 if (preg_match('/^[a-z]/i', $value)) {
  echo $i++ . "\t" . $value . "<br/>";
 }
}
?>

No comments:

Post a Comment

here docs

$x = <<<THE_END PHP stands for "PHP: Hypertext Preprocessor". The acronym "PHP" is therefore, usually referre...