[PHP/TXT]valore aggiunto ad uno esistente
Ciao !
Innanzitutto non sapevo come intitolare il thread :P
Poi ...
Ho creato questo script PHP , che mi scrive il contenuto di un file txt :
pagina.php
Codice PHP:
<?
$var = array_reverse( file("progetti.txt") );
?>
</p>
<table width="100%">
<?
foreach ($var as $riga)
if ( trim($riga) != "" ) {
$lista = explode("|", $riga);
?>
<tr>
<td width="80%"><?=$lista[1]; ?></td>
</tr>
<tr>
<td width="80%"><?=$lista[2]; ?> </td>
</tr>
<?
}//fine ciclo for
?>
</table>
progetti.txt
Codice:
1|CREAZIONE SITO 1|Devo creare il sito 1 .... <br> ....<br> .... FINITO !!!!
2|CREAZIONE SITO2|Devo creare il sito 2 .... <br> ....<br> .... FINITO !!!!
Ora ... il mio problema sta nell'aggiungere al file , un numero costantemente superiore all'ultimo , ad esempio :
-Se l'ultima "news" è la numero 5 , quella che andrò a scvrivere sarà la numero 6 ...
Capito :) ?
Grazie ^_^