« rm: Argument list too longPlesk Awstat forgets the monthly statistics »

4 comments

Comment from: Andrew [Visitor]
Thank you - I like option 2 for php. Is there an easy way to incorporate the following code to sort the index page files by date? This would be useful for sites to list the most recent files near the top.

I see there is code like this but it's not complete (from php.net/opendir ):

[codeblock lang="php" line="1"]
$content_array = array();

//set current working directory
$dirname = "C:\temp";

//Load Directory Into Array
$handle=opendir($dirname);
$i=0;
while ($file = readdir($handle))
if ($file != "." && $file != "..")
{
$content_array[$i][0] = $file;
$content_array[$i][1] = date ("Y m d", filemtime($dirname."/".$file));
$i++;
}
//close the directory handle
closedir($handle);

// these lines sort the contents of the directory by the date
foreach($content_array as $res)
$sortAux[] = $res[1];
array_multisort($sortAux, SORT_ASC, $content_array);
[/codeblock]
01/10/08 @ 14:37
Comment from: Wiboon Warasittichai [Visitor]
Can you make directory list in a drop-down menu? Thanks.
10/10/08 @ 08:19
Comment from: David Newcomb [Member]
Email
Yes - you can!
10/10/08 @ 11:00
Comment from: Dretoot [Visitor]
Your writing is very elegant, very vivid and lively, I really like you, wish you continued to write better articles, I will often try to concern, oh!
24/03/10 @ 08:26

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
Please enter "notspam" (without the quotes) in the box below
antispam test