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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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 17:01:58 2024 UTC