Search
 
SCRIPT & CODE EXAMPLE
 

PHP

scan all directories and files php

<?php
function getDirContents($dir, &$results = array()) {
    $files = scandir($dir);

    foreach ($files as $key => $value) {
        $path = realpath($dir . DIRECTORY_SEPARATOR . $value);
        if (!is_dir($path)) {
            $results[] = $path;
        } else if ($value != "." && $value != "..") {
            getDirContents($path, $results);
            $results[] = $path;
        }
    }

    return $results;
}

var_dump(getDirContents('/xampp/htdocs/WORK'));
Comment

PREVIOUS NEXT
Code Example
Php :: laravel get input from request 
Php :: php get php.ini location from termina 
Php :: laravel use model inside blade 
Php :: php base64 to image 
Php :: php check if get var is set 
Php :: bindings laravel 
Php :: laravel where has 
Php :: php array formatted output 
Php :: asset not working in laravel 
Php :: carbon date format 
Php :: laravel relationship with for single data 
Php :: laravel get fillable attributes 
Php :: php artisan migrate could not find driver 
Php :: Magento 2 -Limit the length of the product name on the front end. 
Php :: laravel make model and controller 
Php :: PHP | get client ip simple 
Php :: add new column in existing table in laravel migration 
Php :: read csv php 
Php :: carbon finer 
Php :: php add one day to date 
Php :: wordpress get link to post by id 
Php :: diff for seconds laravel carbon 
Php :: laravel create model with migration 
Php :: blade foreach key value 
Php :: toaster message in laravel 
Php :: factorial program in php using recursive function 
Php :: laravel difference between current time and created time 
Php :: carbon random future date 
Php :: array_key_exists vs isset 
Php :: laravel where update query 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =