Answers for "php check if folder empty"

PHP
0

php check if folder empty

<?php
  $dir = 'directory'; // dir path assign here
  echo (count(glob("$dir/*")) === 0) ? 'Empty' : 'Not empty';
?>
Posted by: Guest on January-03-2022

Browse Popular Code Answers by Language