note 9087 deleted from function.fgets by spic
| From: | spic@php.net | Date: | Tue, 17 Sep 2002 09:25:58 +0000 |
| Subject: | note 9087 deleted from function.fgets by spic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36793@lists.php.net to get a copy of this message | ||
[Editor's note: A simpler solution is to use chop() or trim(), e.g.:
$buffer = chop(fgets($fp, 4096));
will suffice.]
To strip the newline caracter at the end of the string:
$buffer = fgets($fp, 4096);
$buffer=str_replace(chr(10),"",$buffer);
$buffer=str_replace(chr(13),"",$buffer);