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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
30 - 12 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 12:01:29 2024 UTC