At 14:05 17-1-2003, you wrote:
On Friday 17 January 2003 20:59, Artur Bereśniewicz wrote:

> how can I open text file and start reading in the middle of it?

AFAIK it's not possible to jump directly into the middle of a file and start
reading.

You would have to read it line-by-line until you get to the part you're
interested in.

If the file isn't large (say less than several MBs) then just read it all into
an array using file() and process it from there.
Well why not try something like this

<?PHP
$filename="halffile.txt";

$fp=fopen("$filename","r");
fseek($fp,$numpoint);

//jump to midfile
$middle_of_file=(filesize($filename))/2;
echo "\n".$middle_of_file;
$precontent=fread($fp,$middle_of_file);

$content=fread($fp,filesize("$filename"));
fclose($fp);
echo nl2br($content);

exit();
?>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to