Search
 
SCRIPT & CODE EXAMPLE
 

PHP

multi file delete in php

<?php
 $dir = '/uploads/';
if ($handle = opendir($dir)) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") { // strip the current and previous directory items
            unlink($dir . $file); // you can add some filters here, aswell, to filter datatypes, file, prefixes, suffixes, etc
        }
    }
    closedir($handle);
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: error correction in qr code php 
Php :: Builder Pattern Method Chaining 2 
Php :: how to refresh a php variable without reloading page 
Php :: php artisan insert user in database with tinker 
Php :: Maximum precision of float in PHP 
Php :: Laravel 9.x Terminal can not migrate table 
Php :: list bulan php 
Php :: simple php round When a negative value is passed as a parameter 
Php :: building an ecommerce website with laravel 
Php :: php get current datetime in us chicago 
Php :: laravel ignition dark mode 
Php :: magento 2.4.3 how to log 
Php :: laravel sintax 
Php :: with() multiple relationship 
Php :: How to add watermark in FPDF PHP - Parte 2 
Php :: create procedure with pdo php 
Php :: var_dump-type and value of expresion 
Php :: how can we export larage data from table in laravel 8 
Php :: newrelic notice err with custom attributes 
Php :: woocommerce_continue_shopping_redirect 
Php :: laravel add model to one to many relationship 
Php :: set additional params to form laravel 
Php :: HTTP Authentication example forcing a new name/password 
Php :: remove a specific element from array inside a loop php 
Php :: Read the index and hashid of the last block in the blockchain 
Php :: Route::whereIn 
Php :: teaching php in interactive mode 
Php :: Get authors who has posts in category - WordPress 
Php :: Store Notice 
Php :: pagenavi plugin 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =