开发者

Using scandir() with Magento

开发者 https://www.devze.com 2023-02-05 22:04 出处:网络
For the home page of my Magento store, I am using a basic gallery script which scans a predefined directory using scandir() and outputs each filename to be displayed in the gallery.

For the home page of my Magento store, I am using a basic gallery script which scans a predefined directory using scandir() and outputs each filename to be displayed in the gallery.

Everything works ok on my local machine, but the script seems to ignore the scandir() and just proceeds as normal without any errors or warnings. If I replace the scandir() and input the filenames dir开发者_开发知识库ectly, the gallery script works fine.

What is going wrong here?


Hard to tell without seeing your code in context, but my guess if scandir is returning an empty array, probably because you're not passing it what you think you're passing it. Add some debugging to your calls to scandir

$path;
var_dump($path);

$results = scandir($path);
var_dump($results);

and you should have a better idea of whats going on.

0

精彩评论

暂无评论...
验证码 换一张
取 消