Another php question :)
I have 3 .txt files in a folder with div contents.
I want to show the latest updated .txt file into my homepage.
I found a code which is very close to the outcome I wanted....
I have this code:
Quote:
<?php
$files = glob( 'video/archives/*.*' );
// Sort files by modified time, latest to earliest
// Use SORT_ASC in place of SORT_DESC for earliest to latest
array_multisort(
array_map( 'filemtime', $files ),
SORT_NUMERIC,
SORT_DESC,
$files
);
// do whatever you want with $files
print_r( $files );
?>
the outcome is:
Quote:
Array ( [0] => video/archives/1.txt [1] => video/archives/2.txt [2] => video/archives/3.txt )
-------------------
the code prints the last updated .txt files.
But I want to show the content of the .txt files instead of just printing it...
maybe I need to replace this code:
to something...Quote:
print_r( $files );
but don`t know how...
Thankyou in advance :)
