change order

This commit is contained in:
wlx 2012-09-18 05:13:47 +00:00
parent 31a44ad226
commit 756ce90b97
1 changed files with 15 additions and 15 deletions

View File

@ -35,6 +35,20 @@ class mydir{
return $this->list[count($this->list)-1]; return $this->list[count($this->list)-1];
} }
function array_flat($array)
{
foreach($array as $a)
{
if(is_array($a))
{
$tmp = array_merge($tmp, array_flat($a));
}else {
$tmp[] = $a;
}
}
return $tmp;
}
function recursive($dir) function recursive($dir)
{ {
$files = array(); $files = array();
@ -57,19 +71,5 @@ class mydir{
closedir($handle); closedir($handle);
} }
return $this->array_flat($files); return $this->array_flat($files);
} }
function array_flat($array)
{
foreach($array as $a)
{
if(is_array($a))
{
$tmp = array_merge($tmp, array_flat($a));
}else {
$tmp[] = $a;
}
}
return $tmp;
}
} }