Hi everyone,
I just wrote this script to read information from a TXT file that contains list of JPEG files, and the list is rather huge. So I want to limit the number of displayed files to like 20 per page (with NEXT/PREVIOUS links to the next or previous 20), but I have no clue how to do it.
Here's the script:
***********************
<?php
$ls = file("data.txt");
for($i=0;$i<count($ls);$i++) {
$np = trim($ls[$i]);
$np = ereg_replace(".jpg","",$np);
$np = explode("-",$np);
echo " Artist: n";
echo ereg_replace( "_", " ", $np[0] );
echo " Title: n";
echo ereg_replace( "_", " ", $np[1] );
echo " Cover: n";
echo ereg_replace( "_", " ", $np[2] );
echo "<br>n";
}
?>
**********************************

Now this reads files and displays pieces of information for each. How can I limit it to display only the information for 20 files at a time (because if it did all at once it would take quite a while to load the page)?
I found out it has something to do with fseek() function, but I have no clue on how to use it inside the script... Any help?