php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33561 fputcsv() not found
Submitted: 2005-07-04 05:56 UTC Modified: 2005-07-04 12:56 UTC
From: cakersq at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.0.4 OS: Windows 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cakersq at gmail dot com
New email:
PHP Version: OS:

 

 [2005-07-04 05:56 UTC] cakersq at gmail dot com
Description:
------------
Using either the precombiled php-cgi.exe file or using it as an Apache2 module, when I run any script that calls the function fputcsv(), it reports function not found.

My PHP.INI File is the recommended one, with a change to enable automatic end of line detection.

Reproduce code:
---------------
Sample from PHP 5.0.4 Manual, but it fails with any script I write.

<?php
$list = array (
    'aaa,bbb,ccc,dddd',
    '123,456,789',
    '"aaa","bbb"'
);
$fp = fopen('file.csv', 'w');
foreach ($list as $line) {
    fputcsv($fp, split(',', $line));
}
fclose($fp);
?>

Expected result:
----------------
The array should be put into a Comma Separated File.

Actual result:
--------------
The browser reports:

Fatal error: Call to undefined function fputcsv() in test.php on line 9


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-04 09:43 UTC] sniper@php.net
That function was added for PHP 5.1.


 [2005-07-04 09:58 UTC] derick@php.net
But the docs say "PHP 5" and not "PHP 5.1".
 [2005-07-04 12:56 UTC] nlopess@php.net
This a bug in the functable script.
There is already other bug opened to track the problem. Jakub has made the patch and we are waiting for Harmut to apply it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 09:01:33 2024 UTC