20 lines pagination
Posted: Sun Nov 09, 2008 5:24 am
Hi,
I am writing a script for displaying quotes. It reads froma txt file where quotes are delimited by \n
Now my requirement is to show 20 quotes i.e. 20 lines on each page how to paginate this?
I am writing a script for displaying quotes. It reads froma txt file where quotes are delimited by \n
Now my requirement is to show 20 quotes i.e. 20 lines on each page how to paginate this?
Code: Select all
<?php
$delim = "\n";
$quotefile = "quotes.txt";
// okay, let's get going.
$fp = fopen($quotefile, "r");
$contents = fread($fp, filesize($quotefile));
$quote_arr = explode($delim,$contents);
fclose($fp);
echo $quote_arr;
?>