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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jomarca1 at eresmas dot com
New email:
PHP Version: OS:

 

 [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-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 22 15:01:24 2021 UTC