0
我有現在下面的代碼,我想簡單的添加EXIF標題數據,其中的「標題」文本。我怎麼做?我知道如何獲取數據,但我不知道如何將它添加到我已經使用的「foreach」循環中。添加EXIF標題到PHP庫
<?php
$path = "./images/bettydew/";
$file_array = array();
readThisDir ($path, &$file_array);
echo '<ul class="gallery">';
foreach ($file_array as $file)
{
if (strstr($file, "png")||strstr($file, "jpg")||strstr($file, "bmp")||strstr($file, "gif"))
{
echo '<li><a href="javascript:void(0);"><img src="'.$file.'" alt="'.$file.'"/></a></li>';
}
}
echo '</ul>';
function readThisDir ($path, $arr)
{
if ($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
if (is_dir ($path."/".$file))
{
readThisDir ($path."/".$file, &$arr);
} else {
$arr[] = $path."/".$file;
}
}
}
closedir($handle);
}
}
?>
SO讀者:這個問題隱含地提到這個問題:http://stackoverflow.com/questions/4981632/php-dynamic-gallery-problem/4981887#4981887 – jpwco 2011-02-13 04:11:15