标签:
遍历访问文件夹:
function read_folder_directory($dir)
{
$listDir = array();
if($handler = opendir($dir)) {
while (($sub = readdir($handler)) !== FALSE) {
if ($sub != "." && $sub != ".." && $sub != "Thumb.db" && $sub != "Thumbs.db") {
if(is_file($dir."/".$sub)) {
$listDir[] = $sub;
}elseif(is_dir($dir."/".$sub)){
$listDir[$sub] = read_folder_directory($dir."/".$sub);
}
}
}
closedir($handler);
}
return $listDir;
}
删除数组特定的值
$k = array_search($value,$arr);
if(! $k === false)
{
unset($arr[$k]);
}
标签:
原文地址:http://www.cnblogs.com/phplhs/p/5503497.html