php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51626 Strange fputcsv reaction
Submitted: 2010-04-21 15:45 UTC Modified: 2010-04-21 16:28 UTC
From: marhei at mac dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.3.2 OS: Ubuntu 9.10
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: marhei at mac dot com
New email:
PHP Version: OS:

 

 [2010-04-21 15:45 UTC] marhei at mac dot com
Description:
------------
$handle = open('test.csv','r+');
fputcsv($handle,$content);

overwrite the last already in the file standing line.

If i write this, the last line is not overwritten:

$handle = open('test.csv','r+');
while($current = fgetcsv(handle)) {
    //Nothing
}
fputcsv($handle,$content);

Test script:
---------------
//Does not work
$handle = open('test.csv','r+');
fputcsv($handle,$content);
//Work
$handle = open('test.csv','r+');
while($current = fgetcsv(handle)) {
    //Nothing
}
fputcsv($handle,$content);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-21 16:28 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2010-04-21 16:28 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Read about the 'mode' parameter:
http://docs.php.net/manual/en/function.fopen.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 00:01:27 2024 UTC