| 
	
 | 
 Posted by test on 06/25/55 11:44 
Hi, 
 
I am using fgets() to recieve an article from a NNTP server. 
The articles end with: 
 
.. 
 
or in other words: <crlf>.<crlf> 
 
My code that reads the article always hangs when it reaches 
the end, and I don't understand why. Can you help me write the 
condition for the while() statement? This is the code: 
 
fputs($soket, "article 91500\n"); 
$t = fgets($soket, 1024); 
 
$i=0; 
// OK so far 
 
while ($t != ".") {   // this doesn't work, nor does ".\n" 
  $i++; 
  $sve[$i] = $t; 
  $t = fgets($soket, 1024); 
}
 
  
Navigation:
[Reply to this message] 
 |