View Single Post
  #2   IP: 153.99.39.110
Old 2016-08-16, 12:45 AM
Karen Karen is offline
初级会员
 
Join Date: 2014-02-10
Posts: 1
Karen 现在声名狼藉
Default

PHP's glob() function let's you specify a pattern to search for. PHP has a great function to help you capture only the files you need. Its called glob()

glob - Find pathnames matching a pattern
Here is an example usage -
Code:
$files = array();
foreach (glob("/path/to/folder/*.txt") as $file) {
  $files[] = $file;
}
Reply With Quote