php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15550 Fgets don?t get a file line correctly
Submitted: 2002-02-14 05:45 UTC Modified: 2002-07-11 02:28 UTC
From: jomarca1 at eresmas dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.1 OS: W98
Private report: No CVE-ID: None
 [2002-02-14 05:45 UTC] jomarca1 at eresmas dot 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-11 02:28 UTC] sniper@php.net
Use 'fopen($fichero, "rb")' (binary mode)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC