我想知道如何使用以下变量在php中加载图像:
<?php
foreach (glob('cam/*.jpg') as $f) {
# store the image name
$list[] = $f;
}
sort($list); # sort is oldest to newest,
echo array_pop($list); # Newest
?>
如何从array_pop($list)
加载图像文件?
答案 0 :(得分:0)
<?php
foreach (glob('cam/*.jpg') as $f) {
# store the image name
$list[] = $f;
}
sort($list); # sort is oldest to newest,
echo '<img src="'.array_pop($list).'">';
&GT;