<?
$step = 20;
$file = file('text.txt');
$total = count($file);
$page = isset($_GET['page']) ? abs(intval($_GET
['page'])) : 0;
if(($page+$step) > $total){
$next = $total;
}else{
$next = $page+$step;
}
for($i=$page; $i<$next; $i++){
echo $file[$i].'<br>';
}
?>