从目录中显示图像 [英] Displaying Images form a Directory
问题描述
新年快乐,每个人!
我想弄清楚如何显示一堆图像(主要是
JPEG,但可能是一些GIF和PNG也存储在系统上的
本地目录中。我可以使用glob()函数来做这件事,
但我似乎无法放入
webroot中的一个目录。例如,我只能输入/ uploads。而不是
" / Volumes / jray / Pictures ..." ;.
任何想法如何解决这个问题?如果我不能使用glob函数,
它很好,但我只想要显示图像(而不是任何其他的
文件,它们很有用。存储在该目录中)。
提前致谢!
Happy New Year, Everyone!
I am trying to figure out how to display a bunch of images (mainly
JPEGs, but possibly a few GIFs and PNGs as well) that are stored in a
local directory on the system. I can do this with the glob() function,
but I can''t seem to put in a directory other than one within the
webroot. For example, I can only put "/uploads" and not
"/Volumes/jray/Pictures...".
Any ideas how to get around this? If I can''t use the glob function,
it''s fine, but I only want images to be displayed (and not any other
file that happpens to be stored in that directory).
Thanks in advance!
推荐答案
< ?php
//关于列出图像的示例。
<?php
// An Example about listing Images.
dir ="。" ;;
dir = ".";
odir = opendir(
odir = opendir(
这篇关于从目录中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!