我正在尝试使用 php 删除文件夹中的图像,但我似乎收到此错误:注意:第 89 行 C:\xampp\htdocs\teadmised\upload.php 中的数组到字符串的转换为什么我不能用数组值添加字符串值? $stmt = $pdo->query('SELECT image FROM posts WHERE post_id =' . $number . ' AND NOT image="noimage.png";'); $allFileNames = $stmt->fetchAll(); $countAllNames = count($allFileNames); for($i=0; $i < $countAllNames; $i++) { $path = "uploads/" . $allFileNames[$i]; // something is wrong in here if(!unlink($path)) { echo "You have an error!"; exit(); } }
- 1 回答
- 0 关注
- 86 浏览
添加回答
举报
0/150
提交
取消