I want to display all the images in the upload directory on my server-side browser. How do I get this code?
I saw an example on the Internet, but I can’t use it. What is written in the second foreach? Mine doesn’t have pagination. There are only two pictures in it
<code>$img = array('gif','png','jpg');//所有图片的后缀名 $dir = 'data/';//文件夹名称 $pic = array(); foreach($img as $k=>$v) { $pattern = $dir.'*.'.$v; $all = glob($pattern); $pic = array_merge($pic,$all); } foreach($pic as $p) { //分行分页显示代码 }</code>
I want to display all the images in the upload directory on my server-side browser. How do I get this code?
I saw an example on the Internet, but I can’t use it. What is written in the second foreach? Mine doesn’t have pagination. There are only two pictures in it
<code>$img = array('gif','png','jpg');//所有图片的后缀名 $dir = 'data/';//文件夹名称 $pic = array(); foreach($img as $k=>$v) { $pattern = $dir.'*.'.$v; $all = glob($pattern); $pic = array_merge($pic,$all); } foreach($pic as $p) { //分行分页显示代码 }</code>
Make a soft link to your picture folder to a directory that can be accessed by the web. Then you can write a web page loop output to display them. If your directory itself can be accessed, then just write HTML output in your existing code segment.
Is the effect you want to be:
system("Path of the picture browser program, path of the picture")
......