Bug #15550 Updated: Fgets don´t get a file line correctly
| From: | sniper@php.net | Date: | Thu, 11 Jul 2002 06:28:04 +0000 |
| Subject: | Bug #15550 Updated: Fgets don´t get a file line correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13828@lists.php.net to get a copy of this message | ||
ID: 15550
Updated by: sniper@php.net
Reported By: jomarca1@eresmas.com
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: W98
PHP Version: 4.1.1
New Comment:
Use 'fopen($fichero, "rb")' (binary mode)
Previous Comments:
------------------------------------------------------------------------
[2002-02-14 05:45:17] jomarca1@eresmas.com
I programmed a function that gets lines from file.
/****************************************************/
$desc_fichero= fopen($fichero,"r");
$correcto = $correcto & $desc_fichero;
if($desc_fichero){/*** Si el fichero se abre correctamente ******/
while(!feof($desc_fichero))
{
$linea= fgets($desc_fichero,1000);
$linea = trim($linea);
if (!empty($linea)..........
In version 4.0.6 fgets took the file line as is(Whith all
characters).In newer version 4.1.1.converts the diferent tabs to a one
space.Example:
"Hi->->->How are you": 4.1.1= "Hi how are you" .
4.0.6:"Hi->->->How are you":
Thanks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15550&edit=1