?? query.php
字號:
<?php
function latest_content() {
$files = glob("data/*.html");
if (count($files) == 0)
return '';
rsort ($files, SORT_STRING);
return file_get_contents($files[0]);
}
$action = $_REQUEST["action"];
if (!$action || $action == "latest") {
echo latest_content();
} else if ($action == "draft") {
if (file_exists("data/.draft.html")) {
echo file_get_contents("data/.draft.html");
} else {
echo latest_content();
}
} else if ($action == "history") {
$files = glob("data/*.html");
rsort($files, SORT_STRING);
foreach ($files as $f) {
if ($f != ".draft.html") {
printf ("%s\n", $f);
}
}
} else if ($action == "file") {
$fname = $_REQUEST['filename'];
if (file_exists($fname)) {
$content = file_get_contents($fname);
echo $content;
}
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -