note 31925 deleted from function.fgetcsv by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 18:22:45 +0000 |
| Subject: | note 31925 deleted from function.fgetcsv by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155107@lists.php.net to get a copy of this message | ||
Note Submitter: kmlinac/nospam/ at oliver dot /nospam/efos dot hr
----
This is the solution to Microsoft Excel csv file - this function add last delimiter in line.
<?php
function delimiter()
{
if (is_file("file.csv"))
{
$fp = fopen($file.csv,"r");
while (false!=($line = fgets($fp)))
{
$line = "$line;";
putf($line);
}
fclose($fp);
}
}
//puts dedlimited line in new file
function putf($line)
{
$fp = fopen($file,"a");
fputs($fp,$line);
fclose($fp);
}
/* this readsl line at the time and adds ; as delimiter on line end. Its easy and helpfull*/
delimiter();
?>