我是一个php新手。我需要从文件夹中提取所有图像。jpg 可用。我试图做这样的事情,但它不起作用
$type = 'jpg';
$pics = opendir('admin/upload/server/php/files/thumbnail/');
$result = glob($pics.'*.'.$type);
while ($filename = readdir($result)){
if ($filename != '.' && $filename != '..') {
$path = 'admin/upload/server/php/files/thumbnail/'.$filename;
$image = 'admin/upload/server/php/files/'.$filename;
list($width, $height) = getimagesize($path);
$path = 'http://localhost/site/'.$path;
$image = 'http://localhost/site/'.$image;
有人可以帮我解决它吗?谢谢