Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php check if folder empty

<?php
  $dir = 'directory'; // dir path assign here
  echo (count(glob("$dir/*")) === 0) ? 'Empty' : 'Not empty';
?>
Comment

PREVIOUS NEXT
Code Example
Php :: pdo turn on errors 
Php :: php function to convert string to camelcase 
Php :: how get year of field database in laravel collection 
Php :: php get timezone 
Php :: add another field in existing migration laravel 
Php :: php max value in associative array 
Php :: array_map class method 
Php :: php is scan dir recursive? 
Php :: php parse html 
Php :: console php 
Php :: group in route in laravel 
Php :: woocommerce get user id by email 
Php :: how to count no of words in a string in php without using string functions 
Php :: php artisan cache:clear Failed to clear cache. Make sure you have the appropiate permissions 
Php :: php sort array by key 
Php :: yii2 arraydataprovider 
Php :: laravel new model 
Php :: laravel return data from model to another controller 
Php :: check string length is greater than 0 php 
Php :: Add 5 days to the current date in PHP 
Php :: php convert special characters to normal 
Php :: laravel display error message 
Php :: sortbydesc on a collection laravel 
Php :: how to load data from .env file in php 
Php :: try catch in laravel 
Php :: post type taxonomy loop wordpress 
Php :: php include files 
Php :: where_in codeigniter 
Php :: how to add script in WordPress admin page 
Php :: codeigniter order by random 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =