Martin Zvarík wrote:
$i = 0;
do {
   $r = file_put_contents('file.txt', 'content');
} while($r === false && $i < 3);

if ($r === false) die('error');


Makes sense? or is it enough to do it just once?

You call file_put_contents() once.

it writes an entire file when called.

use fopen/fwrite/fclose to do it line by line.

Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to