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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC