ok my latest .txt file is like this :
italian,www.mydomain.com/image/italian.gif,www.mydomain.com/nation/italian.php,201108060922 /=>this is date
english,www.mydomain.com/image/english.gif,www.mydomain.com/nation/english.php,201108070923
arabic,www.mydomain.com/image/arabic.gif,www.mydomain.com/nation/arabic.php,201108080924
.
.
.
.
goes on
i want to show most recent 20 images by date (which exist in each line ) /And in another page i want to show most recent 21 to 40
And image name on images(italian or english etc.) with image place which i put like www.mydomain.com/image/italian.gif
so when u click an image you will go to the webpage which it links to
Here is the code i found so far but without adding image and linking them. Any suggestions??
<?php
// read file
$file = file_get_contents('YOUR_FILE_NAME_HERE.txt');
// break file into lines
$lines = explode("\n",$file);
// create empty array to hold values
$myArray = array();
// loop through each line
foreach($lines as $line){
// separate fields
$fields = explode(",",$line);
// remove date from array and use as key
$date = array_pop($fields);
$myArray[$date] = $fields;}
// sort array by keys (date)
ksort($myArray);
// initialize counter
$count = 0;
// loop through result and display
foreach($myArray as $date => $values){
// limit to 20
if($count >= 20) break;
// show data
echo "<br>LANGUAGE: ".$values[0];
echo "<br>IMAGE: ".$values[1];
echo "<br>LINK: ".$values[2];
echo "<br>DATE: ".$date;
echo "<hr>";
// increment counter
$count++;}?>