note 99360 added to function.rsort
| From: | jamie at jgmcelwain dot com | Date: | Thu, 12 Aug 2010 15:50:34 +0000 |
| Subject: | note 99360 added to function.rsort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171617@lists.php.net to get a copy of this message | ||
Anyone got any ideas why this would display 1, then 10, then 2, then 20, then 3, then 30?
<?php function xfunction($page = 1, $num_posts = 5) {
$start = (($page - 1) * $num_posts);
$path = "content/posts/";
$files = glob("" . $path . "*.txt");
if ($files) {
rsort($files);
$files = array_slice($files, $start, $num_posts);
foreach ($files as $file) {
print("\n<article>");
include($file);
print("</article>\n");
}
} else {
echo "Somthing's Missing? Maybe you need to <a
href='install.php'>Install?</a>";
}
} ?>
----
Server IP: 69.147.83.197
Probable Submitter: 86.132.150.198
----
Manual Page -- http://www.php.net/manual/en/function.rsort.php
Edit -- https://master.php.net/note/edit/99360
Del: integrated -- https://master.php.net/note/delete/99360/integrated
Del: useless -- https://master.php.net/note/delete/99360/useless
Del: bad code -- https://master.php.net/note/delete/99360/bad+code
Del: spam -- https://master.php.net/note/delete/99360/spam
Del: non-english -- https://master.php.net/note/delete/99360/non-english
Del: in docs -- https://master.php.net/note/delete/99360/in+docs
Del: other reasons-- https://master.php.net/note/delete/99360
Reject -- https://master.php.net/note/reject/99360
Search -- https://master.php.net/manage/user-notes.php