_dirToStruct example

if ($file != '.' && $file != '..') {
                $list[] = $file;
            }
        }

        closedir($dir);
        natsort($list);
        if ($aktinst < $maxinst || $maxinst == 0) {
            foreach ($list as $val) {
                $path = $sPath . DIRECTORY_SEPARATOR . $val;
                if (is_dir($path) && !is_link($path)) {
                    $tmp    = System::_dirToStruct($path$maxinst$aktinst+1, $silent);
                    $struct = array_merge_recursive($struct$tmp);
                } else {
                    $struct['files'][] = $path;
                }
            }
        }

        return $struct;
    }

    /** * Creates a nested array representing the structure of a directory and files * * @param array $files Array listing files and dirs * @return array * @static * @see System::_dirToStruct() */
Home | Imprint | This part of the site doesn't use cookies.