【发布时间】:2023-12-22 02:52:01
【问题描述】:
我有很多文件夹,每个文件夹都包含两个文件:一个名为 thumb,但扩展名未知,另一个我不知道。我的问题是如何获得未知图像的路径?这是脚本:
$path = 'images/2011/May/30/brfZ0ehnBKO/thumb.jpg';
$pathtofile = substr($path, 0, -9); //images/2011/May/30/brfZ0ehnBKO/
$thumbz = $pathtofiles."thumb";
$all = glob('$pathtofiles*.*');
$zip = glob('$thumbz*.*');
$remaining = array_diff($all, $zip);
$thefile = ???;
我希望 $thefile 等于另一个文件...
【问题讨论】:
-
PHP 脚本有什么问题?它不工作吗?如果是,会发生什么?
-
在 php 中做你在第一行所做的事情是否合法?我的意思是一个没有任何引号的字符串
-
$path 来自我刚刚简化的数据库