View Single Post
  #3   IP: 153.99.39.110
Old 2016-08-16, 12:47 AM
Kasen Kasen is offline
初级会员
 
Join Date: 2009-12-02
Posts: 1
Kasen 现在声名狼藉
Default

Code:
<?php
foreach (glob("*.txt") as $filename) {
    echo "$filename size " . filesize($filename) . "\n";
}
?>
or

Code:
//path to directory to scan
$directory = "../file/";

//get all image files with a .txt extension.
$file= glob($directory . "*.txt ");

//print each file name
foreach($file as $filew)
{
echo $filew;
$files[] = $filew; // to create the array

}
Reply With Quote