所以我有这个EasySlider 1.7和加载我想要显示的图像,问题是现在我每次更改图像或添加/删除图像时都需要编辑html文件。
是否可以从文件夹中获取图像,并使用单个脚本在EasySlider中显示它们。示例:脚本转到image文件夹,获取第一个图像并将其放到滑块中。
我尝试了一些php脚本,我得到的最好的结果是当php脚本拉出整个图像文件夹并同时显示它们时,弄乱了滑块。
我希望我的问题说清楚了,英语不是我的母语。
发布于 2012-02-11 22:32:28
您可以使用glob()来获取某个文件夹中的文件数组,如下所示:
$files=glob("/path/*.*"); // an array of the files in the folder
foreach($files as $file) // loops through the array and prints out the files
echo $file;将其与EasySlider放在合适的位置,这样您就不需要在每次添加/删除文件时都编辑html。
https://stackoverflow.com/questions/9240911
复制相似问题