You should try to get your text into an array.
If your text comes from an external file:
PHP Code:
$fileContents = file ( './path_to_file/file.txt' );
Otherwise, if you have it as a string, try:
PHP Code:
$fileContents = explode ( "\n", $yourText ); // Splits the text at NEWLINES
You now have an array. Suppose you want to show the first 25 pages
PHP Code:
$i = 0;
while ( $i < 25 )
{
echo $line . "<BR>\n";
$i++;
}
Lines 25 -> 50
PHP Code:
$i = 25;
while ( $i < 50 )
{
echo $line . "<BR>\n";
$i++;
}
Etc etc etc
I suppose you could work out some smart formula that would allow this:
PHP Code:
// Link: yourpage.php?page=2
$linesPerPage = 25;
$startLine = $linesPerPage * $_GET['page'];
$endLine = $startLine + $linesPerPage;
while ( $startLine < $endLine )
{
echo $fileContent[ $startLine ];
$startLine++;
}
Bookmarks