<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura]]></title><description><![CDATA[<p dir="auto">Salve a tutti<br />
ho la necessità di leggere un file da cvs , modificarlo e scriverlo successivamente.</p>
<p dir="auto">Sono riuscito a prendere un file csv e stamparlo a video<br />
Successivamente sono riuscito anche a fare delle modifiche al file ( creazione condizioni , concatena e operazioni algebriche)<br />
Fin qui tutto bene</p>
<p dir="auto">mi blocco invece ora nel salvare questo file?<br />
come si fa?</p>
<p dir="auto">stampando a video il file, questo viene di per se messo in tabelle<br />
per farlo ritornare in csv come posso fare?</p>
<p dir="auto">ho visto questa funzione ma come posso applicarla al mio file cvs?</p>
<pre><code class="language-php">&lt;?php
$list = array (
    array('aaa', 'bbb', 'ccc', 'dddd'),
    array('123', '456', '789'),
    array('"aaa"', '"bbb"')
);
$fp = fopen('file.csv', 'w');
foreach ($list as $fields) {
    fputcsv($fp, $fields);
}
fclose($fp);
?&gt;
</code></pre>
<p dir="auto">grazie del vostro aiuto</p>
]]></description><link>https://dev.connect.gt/topic/221362/operazioni-con-file-csv-tramite-php-lettura-modifica-scrittura</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 02:54:54 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/221362.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Feb 2016 19:39:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Fri, 03 Jun 2016 15:43:51 GMT]]></title><description><![CDATA[<p dir="auto">riesco solo a stampare i titoli di colonne a video ma non a salvarlo<br />
ho modificato cosi il file<br />
e riesco solo a vederle nel file a video ma nel csv di destinazione che si salva non appaiono..</p>
<pre><code>&lt;?php print "&lt;table border=1 width=90% &gt;";$fd= fopen ("file.csv", "r");
$destinazione = fopen('destinazione.csv', 'w');
// Intestazione Tabella
print "&lt;tr&gt;";
print "&lt;td&gt;COLONNA 1&lt;/td&gt;";
print "&lt;td&gt;COLONNA 2&lt;/td&gt;";
print "&lt;td&gt;COLONNA 3&lt;/td&gt;";
print "&lt;td&gt;COLONNA 4&lt;/td&gt;";
print "&lt;/tr&gt;";
$x=0; 
while (!feof ($fd))
{     
$riga=fgets($fd, 4096);     
if($riga!="")     
{    
$arr=split(";", $riga);   
  
$arr[3]= $arr[3] * 100; 


print "&lt;tr&gt;";          
print "&lt;td&gt;".$arr[0]."&lt;/td&gt;";          
print "&lt;td&gt;".$arr[1]."&lt;/td&gt;";          
print "&lt;td&gt;".$arr[2]."&lt;/td&gt;";          
print "&lt;td&gt;".$arr[3]."&lt;/td&gt;";                     
print "&lt;/tr&gt;";         
$x++;  
}  
fputcsv($destinazione, $arr);
}
print "";
fclose($fd);
flcose($destinazione);
?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1217672</link><guid isPermaLink="true">https://dev.connect.gt/post/1217672</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Fri, 03 Jun 2016 15:43:51 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Fri, 03 Jun 2016 15:25:00 GMT]]></title><description><![CDATA[<p dir="auto">Se devi solo cambiare l'intestazione delle colonne potresti aggiungere la nuova intestazione prima del primo giro di lettura del file. Inizi con l'intestazione e successivamente accodi il file letto come stai già facendo, può andare o sono sulla strada sbagliata?</p>
]]></description><link>https://dev.connect.gt/post/1217663</link><guid isPermaLink="true">https://dev.connect.gt/post/1217663</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Fri, 03 Jun 2016 15:25:00 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Fri, 03 Jun 2016 10:41:39 GMT]]></title><description><![CDATA[<p dir="auto">In pratica mi occorre che il nuovo file cvs generato abbia un titolo di colonne nuovo anche perchè in alcuni casi le colonne create sono nuove e mi occorre scrivere per tutte le nuove colonne un titolo per facilitarne poi l'uso.</p>
]]></description><link>https://dev.connect.gt/post/1217674</link><guid isPermaLink="true">https://dev.connect.gt/post/1217674</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Fri, 03 Jun 2016 10:41:39 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Fri, 03 Jun 2016 10:14:22 GMT]]></title><description><![CDATA[<p dir="auto">in che senso una nuova intestazione? devi sostituire la precedente?</p>
]]></description><link>https://dev.connect.gt/post/1217662</link><guid isPermaLink="true">https://dev.connect.gt/post/1217662</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Fri, 03 Jun 2016 10:14:22 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Wed, 01 Jun 2016 08:41:24 GMT]]></title><description><![CDATA[<p dir="auto">Ragazzi scusatemi se apro nuovamente la discussione.<br />
Lo script php funziona a meraviglia ma mi occorre una piccolissima modifica<br />
Nel file cvs salvato mi occorre che sia presente una nuova intestazione di colonne.<br />
Come posso crearla?</p>
<p dir="auto">Grazie ancora</p>
]]></description><link>https://dev.connect.gt/post/1217671</link><guid isPermaLink="true">https://dev.connect.gt/post/1217671</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Wed, 01 Jun 2016 08:41:24 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Fri, 25 Mar 2016 17:12:39 GMT]]></title><description><![CDATA[<p dir="auto">aggiornamento<br />
ce l'ho fatta a salvare con il delimitatore ;<br />
semplicemente inserendolo nel fputcsv<br />
cosi...<br />
fputcsv($destinazione, $arr, $delimiter = ';');</p>
<p dir="auto">grazie ancora di cuore!!</p>
]]></description><link>https://dev.connect.gt/post/1217668</link><guid isPermaLink="true">https://dev.connect.gt/post/1217668</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Fri, 25 Mar 2016 17:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Fri, 25 Mar 2016 16:15:23 GMT]]></title><description><![CDATA[<p dir="auto">ce l'ho fatta<br />
ho semplicemente variato:<br />
$arr[3]= $arr[3] * 100;</p>
<p dir="auto">ti chiedo un ultima cosa.<br />
il file di partenza file.csv ha come separatore il ; ma il file salvato destinazione.csv ha come separatore la ,<br />
come posso dare anche alla destinazione il ; come separatore?</p>
<pre><code>[COLOR=#0000BB][FONT=monospace]&lt;?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;table border=1 width=90% &gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fopen [/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"file.csv"[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"r"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$destinazione [/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fopen[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'destinazione.csv'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'w'[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$x[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
while (![/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]feof [/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace]))
{     
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$riga[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fgets[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]4096[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);     
if([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$riga[/FONT][/COLOR][COLOR=#007700][FONT=monospace]!=[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]""[/FONT][/COLOR][COLOR=#007700][FONT=monospace])     
{    
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]split[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]";"[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$riga[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);   
  
[/FONT][/COLOR][B]$arr[3]= $arr[3] * 100;[/B][COLOR=#007700][FONT=monospace] 

print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;tr&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];          
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];          
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];          
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]2[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];          
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]3[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];          [/FONT][/COLOR][COLOR=#007700][FONT=monospace]           
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/tr&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];         
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$x[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++;  
}  
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fputcsv[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$destinazione[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
}
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]""[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fclose[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]flcose[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$destinazione[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?&gt;[/FONT][/COLOR]
</code></pre>
]]></description><link>https://dev.connect.gt/post/1217670</link><guid isPermaLink="true">https://dev.connect.gt/post/1217670</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Fri, 25 Mar 2016 16:15:23 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Thu, 24 Mar 2016 07:40:34 GMT]]></title><description><![CDATA[<p dir="auto">esatto<br />
potresti ricostruire un nuovo array con i valori modificati e salvare quello nel file.</p>
]]></description><link>https://dev.connect.gt/post/1217661</link><guid isPermaLink="true">https://dev.connect.gt/post/1217661</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Thu, 24 Mar 2016 07:40:34 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Tue, 22 Mar 2016 08:38:32 GMT]]></title><description><![CDATA[<p dir="auto">Grazie mille<br />
finalmente ho fatto un passo in avanti e riesco ora a sbloccarmi<br />
ti volevo chiedere come faccio ad inserire un valore modificato nell'array?<br />
a video lo vedo ma non me la salva nel file</p>
<p dir="auto">ad esempio la 5 colonna la voglio moltiplicare per 100<br />
e faccio questa cosa ma nonostante la vedo a video non la vedo nel file salvato.<br />
il valore deve essere poi inserito nell'array vero?<br />
come faccio?</p>
<p dir="auto">grazieeee</p>
<pre><code class="language-php">&lt;?php print "&lt;table border=1 width=90% &gt;";
$fd= fopen ("file.csv", "r");
$destinazione = fopen('destinazione.csv', 'w');
$x=0; 
while (!feof ($fd))
{     
$riga=fgets($fd, 4096);     
if($riga!="")     
{    
$arr=split("\|", $riga);     
$a= $arr[4] * 100;     
print "&lt;tr&gt;";          
print "&lt;td&gt;".$arr[0]."&lt;/td&gt;";          
print "&lt;td&gt;".$arr[1]."&lt;/td&gt;";          
print "&lt;td&gt;".$arr[2]."&lt;/td&gt;";          
print "&lt;td&gt;".$arr[3]."&lt;/td&gt;";          
print "&lt;td&gt;".$a."&lt;/td&gt;";               
print "&lt;/tr&gt;";         
$x++;  
}  
fputcsv($destinazione, $arr);
}
print "";
fclose($fd);
flcose($destinazione);
?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1217667</link><guid isPermaLink="true">https://dev.connect.gt/post/1217667</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Tue, 22 Mar 2016 08:38:32 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Thu, 17 Mar 2016 19:14:54 GMT]]></title><description><![CDATA[<p dir="auto">Ciao<br />
io proverei così:</p>
<pre><code>[COLOR=#0000BB][FONT=monospace]&lt;?[URL="http://www.giorgiotave.it/wikigt/os/PHP"]php[/URL] 
[/FONT][/COLOR][COLOR=#007700][FONT=monospace]print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;table border=1 width=90% &gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace]= [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fopen [/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"file.csv"[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"r"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
$destinazione = [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fopen[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'destinazione.csv'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'w'[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);[/FONT][/COLOR][COLOR=#007700][FONT=monospace]
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$x[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
while (![/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]feof [/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace]))
{   
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]  $riga[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fgets[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]4096[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);   
  if([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$riga[/FONT][/COLOR][COLOR=#007700][FONT=monospace]!=[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]""[/FONT][/COLOR][COLOR=#007700][FONT=monospace])   
  {
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]    $arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]split[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"\|"[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$riga[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);      
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;tr&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];      
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]0[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];      
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]1[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];      
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]2[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];      
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]3[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];      
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace].[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]4[/FONT][/COLOR][COLOR=#007700][FONT=monospace]].[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/td&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];           
    print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"&lt;/tr&gt;"[/FONT][/COLOR][COLOR=#007700][FONT=monospace];     
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$x[/FONT][/COLOR][COLOR=#007700][FONT=monospace]++;
  }
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]  fputcsv[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$destinazione[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$arr[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);[/FONT][/COLOR][COLOR=#007700][FONT=monospace]
}
print [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]""[/FONT][/COLOR][COLOR=#007700][FONT=monospace];
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]fclose[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$fd[/FONT][/COLOR][COLOR=#007700][FONT=monospace]);
flcose($destinazione);
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?&gt;[/FONT][/COLOR]
</code></pre>
]]></description><link>https://dev.connect.gt/post/1217660</link><guid isPermaLink="true">https://dev.connect.gt/post/1217660</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Thu, 17 Mar 2016 19:14:54 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Sat, 12 Mar 2016 18:26:25 GMT]]></title><description><![CDATA[<p dir="auto">grazie per la risposta<br />
il mio file csv lo apro a video cosi e riesco anche a fare tutte le modifiche</p>
<pre><code class="language-php">&lt;?php 
print "&lt;table border=1 width=90% &gt;";
$fd= fopen ("file.csv", "r");
$x=0; 
while (!feof ($fd))
{   
$riga=fgets($fd, 4096);   
if($riga!="")   
{
$arr=split("\|", $riga);      
print "&lt;tr&gt;";      
print "&lt;td&gt;".$arr[0]."&lt;/td&gt;";      
print "&lt;td&gt;".$arr[1]."&lt;/td&gt;";      
print "&lt;td&gt;".$arr[2]."&lt;/td&gt;";      
print "&lt;td&gt;".$arr[3]."&lt;/td&gt;";      
print "&lt;td&gt;".$arr[4]."&lt;/td&gt;";           
print "&lt;/tr&gt;";     
 $x++;
   }
}
print "";
fclose($fd);
?&gt;
</code></pre>
<p dir="auto">ma come posso farlo risalvare in csv il file?</p>
<p dir="auto">grazieeee</p>
]]></description><link>https://dev.connect.gt/post/1217666</link><guid isPermaLink="true">https://dev.connect.gt/post/1217666</guid><dc:creator><![CDATA[speedcrash]]></dc:creator><pubDate>Sat, 12 Mar 2016 18:26:25 GMT</pubDate></item><item><title><![CDATA[Reply to Operazioni con file CSV tramite PHP. Lettura + modifica + scrittura on Sat, 12 Mar 2016 08:52:59 GMT]]></title><description><![CDATA[<p dir="auto">Ciao<br />
questa è già di per se la funzione di salvataggio del csv.<br />
Attraverso il foreach stai attraversando il tuo array, riga per riga, e lo stai salvando nel file.</p>
]]></description><link>https://dev.connect.gt/post/1217658</link><guid isPermaLink="true">https://dev.connect.gt/post/1217658</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Sat, 12 Mar 2016 08:52:59 GMT</pubDate></item></channel></rss>