php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47936 fgets() not reading spaces
Submitted: 2009-04-09 12:05 UTC Modified: 2009-04-09 12:21 UTC
From: vikrant dot mahajan at topsource dot co dot uk Assigned:
Status: Not a bug Package: Readline related
PHP Version: 5.2.9 OS: XP
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: vikrant dot mahajan at topsource dot co dot uk
New email:
PHP Version: OS:

 

 [2009-04-09 12:05 UTC] vikrant dot mahajan at topsource dot co dot uk
Description:
------------
When fgets() read text file line by line, it eliminate blank spaces if line contains more than one space.

Reproduce code:
---------------
$handle = fopen($myfile, "r");
while (!feof($handle)) 
{
  $getline = fgets($handle);
} 

Expected result:
----------------
line1 one  two             100
line2 12   190             99.20

Actual result:
--------------
line1 one two 100
line2 12 190 99.20

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-09 12:21 UTC] scottmac@php.net
View the source of the output, HTML collapses multiple spaces to a single space.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 06:03:33 2021 UTC