Bloggings

shadocks pumping

Blog | Links | Git | Search | FR

Static Pages

"; // iterate through files $i = 0; $thisdir = new DirectoryIterator("./static"); foreach ($thisdir as $file) { if ($file != "." && $file != "..") { $i++; $content = file_get_contents($file->getPathname()); preg_match("/
(.*?)<\/h5>/s", $content, $date); $filedate = date("Y-m-d"); if (isset($date[1]) && strtotime($date[1])) { $filedate = date("Y-m-d", strtotime($date[1])); } preg_match("/

(.*?)<\/h2>/s", $content, $titre); $title = "?"; if (isset($titre[1])) { $title = ucfirst($titre[1]); } $items[$i][0] = $i; $items[$i][1] = $file->getPathname(); $items[$i][2] = $title; } } $values = array_column($items, 2); array_multisort($values, SORT_ASC, $items); $i = 0; while ($i < count($items)) { echo "
  • " . '' . $items[$i][2] . "
  • "; $i++; } echo ""; ?>

     


    A minimalist blog by Philip Wittamore