The original script is below... but the problem is I was hoping to find a way to define the directory it displayed the contents of:
Code: Select all
<?php
$show = 5;
$files = glob( '*.{html,php,php4,txt}', GLOB_BRACE );
usort( $files, create_function('$b, $a', 'return filemtime( $a ) - filemtime( $b );') );
for ( $i = 0; $i < $show; ++$i )
echo '<a href="', $file = $files[$i], '">', ucfirst( strtolower(substr($file, 0, strpos($file, '.'))) ), '</a> - ', date( 'D, M d, Y', filemtime($file) ), '<br />', "\n";
?>
It used to look like:
File 1 - Jun 28, 2009
And now it looks like:
./files/file_1.htm - Jun 28, 2009
Code: Select all
<?php
$show = 5;
$dir = './DIRECTORY/';
$files = glob( ''.$dir.'*.{html,php,php4,txt}', GLOB_BRACE );
usort( $files, create_function('$b, $a', 'return filemtime( $a ) - filemtime( $b );') );
for ( $i = 0; $i < $show; ++$i )
echo '<a href="', $file = $files[$i], '">', ucfirst( strtolower(substr($file, 0, strpos($file, '.'))) ),$file, '</a> - ', date( 'D, M d, Y', filemtime($file) ), '<br />', "\n";
?>
Any help is appreciated -- thanks in advance!