Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php is scan dir recursive?

function scanAllDir($dir) {
  $result = [];
  foreach(scandir($dir) as $filename) {
    if ($filename[0] === '.') continue;
    $filePath = $dir . '/' . $filename;
    if (is_dir($filePath)) {
      foreach (scanAllDir($filePath) as $childFilename) {
        $result[] = $filename . '/' . $childFilename;
      }
    } else {
      $result[] = $filename;
    }
  }
  return $result;
}
Comment

php is scan dir recursive?

function scanAllDir($dir) {
  $result = [];
  foreach(scandir($dir) as $filename) {
    if ($filename[0] === '.') continue;
    $filePath = $dir . '/' . $filename;
    if (is_dir($filePath)) {
      foreach (scanAllDir($filePath) as $childFilename) {
        $result[] = $filename . '/' . $childFilename;
      }
    } else {
      $result[] = $filename;
    }
  }
  return $result;
}
Comment

PREVIOUS NEXT
Code Example
Php :: share link in facebook php 
Php :: Check if session exists or not in laravel 
Php :: php store log in a text file 
Php :: adding column to array php 
Php :: php how to write at end of the sentence 
Php :: carbon to mysql datetime 
Php :: how to make a model in folder in laravel 
Php :: set php path in ubuntu 
Php :: laravel migration add date of birth column 
Php :: Too Many Attempts. laravel error 
Php :: php artisan cache:clear Failed to clear cache. Make sure you have the appropiate permissions 
Php :: laravel db::query update 
Php :: laravel table in model 
Php :: concat() function using laravel eloquent query 
Php :: delete all rows in table laravel 
Php :: array_search 
Php :: php check if query returns results 
Php :: php remove charictors from a string 
Php :: Laravel seed timestamps columns 
Php :: laravel auth namespace 
Php :: sha256 in php 
Php :: strtotime add 1 hour 
Php :: php pdo select 
Php :: Warning: mysqli_fetch_all() expects parameter 1 to be mysqli_result, bool given in C: ewxammphtdocslearnindex.php on line 11 
Php :: acf options page 
Php :: how login with phone in laravel 
Php :: Laravel query child from parent whereHas 
Php :: aravel 8 how to order by using eloquent orm 
Php :: laravel where like 
Php :: php get total amount of days in month 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =