function ReadImg($Images,$Paths,$Path,$AddPaths,$AddUrl){
$i = sizeof($Images);
$j = sizeof($Paths);
chdir($Path);
$Handle = opendir($Path);
while($File = readdir($Handle)) {
if ($File != "." && $File != ".."){
$CheckItems = explode(".",$File);
if(sizeof($CheckItems) == 1){
$Paths[$j] = $Path.$File.'/';
$AddPaths[$j] = $AddUrl.$File.'/';
$j++;
}
else{
$Images[$i] = $AddUrl.$File;
$i++;
}
}
}
if(sizeof($Paths) != 0){
$NewPath = $Paths[0];
$NewAddPath = $AddPaths[0];
unset($Paths[0]);
unset($AddPaths[0]);
$Paths = array_slice($Paths,0);
$AddPaths = array_slice($AddPaths,0);
$Images = ReadImg($Images,$Paths,$NewPath,$AddPaths,$NewAddPath);
}
closedir($Handle);
return $Images;
}