Re: fsockopen help!

From: Date: Mon, 28 Aug 2000 01:54:50 +0000
Subject: Re: fsockopen help!
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-13877@lists.php.net to get a copy of this message
Joseph H Blythe wrote: > "TaoX { Brian Hinson; }" wrote: > > > The problem with fgets is that it either > > > > - reads until eof... not suitable for network protocols > > - reads until length has been reached... also not known > > - reads until \n, also a major problem > > > > hence you have to use fgetc or fread with length one... and read byte by > > byte to construct a full line... then parse the line for codes/data whatever > > is required of the protocol. > > Ok I'll give the fgetc method a try, now how would one suggest I read from the > file path character by character to 'construct a full line' until the eof is > reached? > Let me put this another way how do I append to a variable during a while loop? example; while ( !feof($fp) ) { $buffer = fgetc($fp); } I want to append to $buffer not overwrite it each cycle of the while loop? I would rather not use an array if possible?? any ideas? Joseph

« previous php.general (#13877) next »