Use \n for newline. \r\n for Windows.

fputs($fp,"value\n");

---John Holmes...
----- Original Message -----
From: "arnaud gonzales" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
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
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to