php - Unlinking an image -
php - Unlinking an image -
here code in want utilize unlink delete image folder "images/slider_images" don’t know how utilize it. here’s code:
$directory = 'images/slider_images/'; seek { // styling images echo '<div id="myslides">'; foreach ( new directoryiterator($directory) $item ) { if ($item->isfile()) { $path = $directory . '/' . $item; echo '<img src="' . $path . '"/>'; } } echo '</div>'; } catch(exception $e) { echo 'no images found slideshow.<br />'; }
it's easy doing unlink($path);
place in loop, retrieve images.
foreach ( new directoryiterator($directory) $item ) { if ($item->isfile()) { $path = $directory . '/' . $item; unlink($path); //deletes images } }
php mysql
Comments
Post a Comment