Re: fputs() pblm how write on a new line each time ?

From: Date: Wed, 22 May 2002 19:57:58 +0000
Subject: Re: fputs() pblm how write on a new line each time ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-98814@lists.php.net to get a copy of this message
Use \n for newline. \r\n for Windows. fputs($fp,"value\n"); ---John Holmes... ----- Original Message ----- From: "arnaud gonzales" <zeg@9online.fr> To: "Php-General" <php-general@lists.php.net> Sent: Wednesday, May 22, 2002 3:56 PM Subject: [PHP] fputs() pblm how write on a new line each time ? > 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. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#98814) next »