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
 [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: Mon Dec 30 14:01:28 2024 UTC