fputs() pblm how write on a new line each time ?
| From: | arnaud gonzales | Date: | Wed, 22 May 2002 19:56:19 +0000 |
| Subject: | fputs() pblm how write on a new line each time ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98812@lists.php.net to get a copy of this message | ||
Hi all,
I' m searching how to write in a file on a new line each times whith
fputs().
Because i want read the file whith file() and so ,have one line per indice
in a table.
So i need to write on a new line each time.
<?
$fic = fopen("toto.txt","a+");
fputs($fic,"on a new line");
fclose($fic);
?>
<?
$tab = file("toto.txt");
for($i=0;$i<count($tab);$i++){
echo "$tab[$i]";
}
?>
TIA.
arnaud.