How to make pagination of files? Hello, help make paginated output files. All files are equally written.
<? $page_title = ''; $page_h1 = ''; $page_descr = ''; $page_keyws = ''; $page_4menu = ''; $page_img = ''; $page_id = '2'; $page_content = <<< EOT <p> текст</p> EOT; ?> Here's how I bring out, but I suffer the same page by page, I can’t fasten it and there’s little knowledge
$articles = glob("./content/*"); if(!$articles) echo ('Нет ни одной страницы...'); else { foreach($articles as $article) { //var_dump($articles); $content=file_get_contents($article); preg_match("|\/content\/(.*).php|Ui", $article, $matches); $file_id=$matches[1]; preg_match("|page_4menu = '(.*)\'\;|Ui", $content, $matches1); $page_4menu=$matches1[1]; preg_match("|page_descr = '(.*)\'\;|Ui", $content, $matches2); $page_descr=$matches2[1]; preg_match("|page_title = '(.*)\'\;|Ui", $content, $matches3); $page_title=$matches3[1]; preg_match("|page_img = '(.*)\'\;|Ui", $content, $matches4); $page_img=$matches4[1]; { echo '<tr style="background-image: url(skin/image/bottom.jpg);"> <td> '.$file_id.'</td> <td> <a href=/'.$arrof[$file_id].'.html target="_blank">'. $page_4menu .'</a></td> <td> <div><a href='. $page_img .' class="highslide" onclick="return hs.expand(this)" ><img width="30" src="'. $page_img .'" title="'. $page_descr .'"></a><div class="highslide-caption">'. $page_descr .'</div></div></td> <td> <a href=edit.php?id='.$file_id.'><img src=skin/image/b_edit.png title="Редактировать"></a></td> <td>'."<a href=# onclick=\"confirmation('$file_id')\"><img src=skin/image/b_drop.png title=\"Удалить страницу\"></a></td></tr>"; } } }
array_chunkto split the array into parts, and then just move through it, back and forth. - And