예제 #1
0
function alert($msg)
{
    header('Content-type: text/html; charset=UTF-8');
    $json = new Services_JSONs();
    echo $json->encode(array('error' => 1, 'message' => $msg));
    exit;
}
예제 #2
0
                        return -1;
                    } else {
                        return 0;
                    }
                }
            } else {
                if ($order == 'type') {
                    return strcmp($a['filetype'], $b['filetype']);
                } else {
                    return strcmp($a['filename'], $b['filename']);
                }
            }
        }
    }
}
usort($file_list, 'cmp_func');
$result = array();
//相对于根目录的上一级目录
$result['moveup_dir_path'] = $moveup_dir_path;
//相对于根目录的当前目录
$result['current_dir_path'] = $current_dir_path;
//当前目录的URL
$result['current_url'] = $current_url;
//文件数
$result['total_count'] = count($file_list);
//文件列表数组
$result['file_list'] = $file_list;
//输出JSON字符串
header('Content-type: application/json; charset=UTF-8');
$json = new Services_JSONs();
echo $json->encode($result);