|
Posted by hackajar on 12/25/06 10:33
Just like in C/C++
http://us2.php.net/manual/en/function.fgets.php
<?php
$handle = @fopen("/tmp/inputfile.txt", "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>
Hackajar
Michael R. Copeland wrote:
> I have an application I've developed in C/C++, written as a console
> application. I need to port it to our Web page in such a manner that it
> operates from a simple menu and searches a large text file database.
> Currently, there are several text files being used together to identify
> the existence of relevant information, as well as allow the program to
> read "directly" (seek/read) the data records. (It's a sort of "indexed
> sequential" design.)
> I've started working with 2 PHP books, and it _looks_ as though PHP
> has the capability to do text file I/o in ways similar to my current
> program. The data files are quite large (10MB), which is why byte
> indexing is needed...as opposed to vast and slow sequential searching.
> Is PHP suitable for something like this? If so, are there any sites
> or NewsGroups I'd benefit from in this endeavor? TIA
[Back to original message]
|