小编imH*_*voc的帖子

为什么$ count不更新?

   $dir_handle = @opendir($url) or die("Unable to open $url");
   $count = "0";
   while ($file = readdir($dir_handle)) {
      if (!is_dir($url.'/'.$file) && ($file="*.jpg" || $file="*.gif" || $file="*.png") && $file!="picture0.*") {
         $galleryEventFile[$count] = $file;
         $count++;
      }
   }
   closedir($dir_handle);
Run Code Online (Sandbox Code Playgroud)

我认为这与这一行有关:

if (!is_dir($url.'/'.$file) && ($file="*.jpg" || $file="*.gif" || $file="*.png") && $file!="picture0.*")
Run Code Online (Sandbox Code Playgroud)

但我不确定

php readdir

0
推荐指数
1
解决办法
113
查看次数

标签 统计

php ×1

readdir ×1