How can I move the pointer to a specific line in a file and get that line?
the path I'm exploring right now is this:
<?php
// p = the entry to start on ( p * 4 = line number)
// n = number of entries to display per page
if ($_GET['n'] == ""){
$numPerPage = 3;
} else ($numPerPage = $_GET['n']);
if ($_GET['p'] == ""){
$startLine = 0;
} else ($startLine = $_GET['p']);
$startLine = $startLine * 4
$numOnPage = 0
$handle = fopen('file.txt','r');
do {
for ($i = $startLine; $i <= $startLine+4; $i++) {
//read (line to array[$i]);
}
//format the gathered lines and echo them
$numOnPage++
} while ($numOnPage < $numPerPage);
fclose($handle)
?>
now obviously this is vanilla code, if someone could please point me in the right direction, as far as how to move the pointer to the correct line and then grab the line...