<?php
$dir = new DirectoryIterator('../images/main_body_image/');
foreach ($dir as $file)
{
$images [] = array (
$file->getPathname() . "\n";
$file->getFilename(). "\n";
);
}
?>
shuffle($images);
你能帮我看看上面的代码吗?我想使用 DirectoryIterator 将图像添加到数组中,然后随机播放图像以生成随机图像。感谢您的宝贵意见。