Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

View Date Created for each file using PHP Script?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

View Date Created for each file using PHP Script?

Postby kenson » Mon Jan 06, 2003 9:26 pm

Hi, :?: i have problem to view date created for each file problem by using php?
Is anyone can help!
Thanks!
:wink:
Cheers,
Kenson
kenson
New php-forum User
New php-forum User
 
Posts: 6
Joined: Mon Jan 06, 2003 9:17 pm

Postby jasonthomasfrance » Mon Jan 06, 2003 11:19 pm

You have get read all the files in a dir like:

Code: Select all
<?php
$dir='thumbs';
if ($handle = opendir($dir))

   $lasttime=0;
   $images=array();
    while (false !== ($file = readdir($handle)))
    {   
      if(is_file($file))$images[$file]=filemtime($file);
    }
}
arsort($images,SORT_NUMERIC);
reset($images);
while(list($filenames,$v)=each($images))
echo "<a href=\"$filenames\"><img src=\"$dir/$filenames\" alt=\"$filenames\" border=\"0\"></a> \n";
?>


And then format the $v variable into a readable date? Don't know if that right or not... But this may head you down the right path...[/code]
jasonthomasfrance
New php-forum User
New php-forum User
 
Posts: 6
Joined: Fri Jan 03, 2003 3:07 am


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.