读TXT$fp = fopen('somefile.txt', 'r');
if (!$fp) {
echo 'Could not open file somefile.txt';
}
while (false !== ($char = fgetc($fp))) {
echo "$char\n";
}
if (!$fp) {
echo 'Could not open file somefile.txt';
}
while (false !== ($char = fgetc($fp))) {
echo "$char\n";
}
if(!isset($page)) {
$page = 1;
}
$words = 1000;
$offset = ($page - 1) * $words;
$content = file_get_content('file.txt',false,NULL,$offset,$words);
echo $content;