【发布时间】:2013-12-06 08:20:34
【问题描述】:
我有一个从文件夹中读取图片的 JavaScript 幻灯片,我需要从 .dat 文件中读取每张图片的描述。 这是脚本:
<?php
require ('macoola.inc');
$upload = new images_upload('installations/', 3000000, 'info.dat');
$photo_list = $upload->read_data(); #this gets unserialized values from info.dat
#read all jpegs in the folder
$path_userspecific_array = explode(";", $_SESSION['userDirs']);
$images_splice = null;
settype($images_splice, "array");
foreach($path_userspecific_array as $thisdir){
$thispath = ('installations/' . $thisdir);
$thisimages = null;
$thisimages = glob($thispath.'/{*.jpg,*.JPG,*.jpeg,*.JPEG}', GLOB_BRACE);
$images_splice = array_merge($images_splice, $thisimages);
}
?>
然后这里是java:
{
image: '<?php
echo $filename ?>',
title: '<?php
**#show description here**
?>',
thumb : '<?php echo $filename ?>'
}
提前谢谢你。
【问题讨论】:
标签: javascript php arrays slideshow