RE: fputcsv() error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, I know.  That is the exact page where I got the code from. If you
notice I copied and pasted what is on that page in my previous email.

--------------------------
fputcsv
(no version information, might be only in CVS)

fputcsv --  Format line as CSV and write to file pointer 
Description
int fputcsv ( resource handle, array fields [, string delimiter [,
string enclosure]])


fputcsv() formats a line (passed as a fields array) as CSV and write it
to the specified file handle. Returns the length of the written string,
or FALSE on failure. 

The optional delimiter parameter sets the field delimiter (one character
only). Defaults as a comma: ,. 

The optional enclosure parameter sets the field enclosure (one character
only) and defaults to a double quotation mark: ". 

Example 1. fputcsv() example

<?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);
?>  
 


Note: If you are having problems with PHP not recognizing the line
endings when reading files either on or created by a Macintosh computer,
you might want to enable the auto_detect_line_endings run-time
configuration option.

See also fgetcsv(). 




 add a note User Contributed Notes
fputcsv 
There are no user contributed notes for this page.

fpassthru fputs 
 
  Last updated: Wed, 20 Oct 2004
----------------------------------------------

Giving me the link to the page with no explanation as to why you gave me
the link to the page does not help in the slightest.  I cannot decipher
the meaning on the page other than:

(no version information, might be only in CVS)

means that the manual is useless.

I'll figure it out by myself.

Steven Altsman 

-----Original Message-----
From: Pablo Gosse [mailto:gossep@xxxxxxx] 
Sent: Tuesday, October 19, 2004 12:40 PM
To: Steven; php-general@xxxxxxxxxxxxx
Subject: RE:  fputcsv() error message

[snip]
Fatal error: Call to undefined function: fputcsv() in
/home/webdev/sites/tracking_site/scripts/report.php on line 19

Is there something that I am missing?  The code that I had entered in:
[/snip]

http://ca.php.net/fputcsv

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux