ct-website/pages/news.php

16 lines
404 B
PHP

<div>
<h1>Новости и политика</h1>
</div>
<?php
$filesList = array_reverse(array_diff(scandir("pages/news/"), array(".", "..")));
foreach ($filesList as &$file) {
$filenamePeaces = explode(".", $file);
$ext = $filenamePeaces[count($filenamePeaces)-1];
if ($ext == "html" || $ext == "php") {
echo "<div>\n";
echo file_get_contents("pages/news/" . $file);
echo "\n</div>";
}
}
?>