这里是我的代码,我想使用unlink从文件夹“images/slider_images”中删除图像,但我不知道如何使用它。这里是我的代码:取消链接图像
$directory = 'images/slider_images/';
try {
// Styling for images
echo '<div id="myslides">';
foreach (new DirectoryIterator($directory) as $item) {
if ($item->isFile()) {
$path = $directory . '/' . $item;
echo '<img src="' . $path . '"/>';
}
}
echo '</div>';
}
catch(Exception $e) {
echo 'No images found for this slideshow.<br />';
}
你可以简单地做unlink($ path); –
我没有看到任何参考删除图像。但是,如果你想取消链接,就直接做。还没有看到问题:取消链接($ path) – Matt
为什么不读取'unlink()'PHP Man手册页? –