Esempio n. 1
0
<?php

require 'function.php';
$picsStr = 'var aPics =[';
$picsStr .= getDirFileName('../images');
$picsStr .= ',' . getDirFileName('../msnface');
$picsStr .= '];';
echo $picsStr;
Esempio n. 2
0
function getDirFileName($dir)
{
    $dh = opendir($dir);
    $i = 0;
    while ($file = readdir($dh)) {
        if ($file != "." && $file != "..") {
            $fullpath = $dir . "/" . $file;
            if (!is_dir($fullpath)) {
                echo "-->" . $file . "<br>";
            } else {
                echo "<br><br>" . $file . "<br>";
                $i = $i + 1;
                getDirFileName($fullpath);
            }
        }
    }
    return $i;
}