Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php delete all files in folder

$files = glob('path/to/temp/*'); // get all file names
foreach($files as $file){ // iterate files
  if(is_file($file)) {
    unlink($file); // delete file
  }
}
Comment

PREVIOUS NEXT
Code Example
Php :: check if valid url php 
Php :: string replace smarty 
Php :: ucfirst() php 
Php :: laravel run seed 
Php :: php save array to file 
Php :: php sum array key 
Php :: php get current datetime mysql format 
Php :: date casting from datetime to d-m-Y laravel 
Php :: force https with php 
Php :: laravel get file name 
Php :: date php 
Php :: get thumbnail alt wordpress 
Php :: ubuntu 20.04 how to install npm 
Php :: laravel foreach loop index 
Php :: php foreach string char 
Php :: Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. 
Php :: php delay redirect 
Php :: db not found in laravel 
Php :: php regex remove file extension 
Php :: seed one table laravel 
Php :: session flush laravel 
Php :: PHP Fatal error: Call to undefined function factory() in Psy Shell code on line 1, LARAVEL 8 Issue solved 
Php :: time to load php page 
Php :: Download a file from external server using PHP - Move one project to another server 
Php :: create laravel project old version 
Php :: get last 3 characters of string in php 
Php :: rename file php 
Php :: php echo html as text 
Php :: php array_merge 
Php :: Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated. 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =