On 06-Jul-01 James Bartlett wrote:
> Hi,
> 
> I'm trying to write data to a file but for some reason it will not store
> numbers in the file...Here's the code I'm using...(as an example)
> 
> <?php
> $fp = fopen("./data.txt", "w+");

if ($fp) {           // always, always ! test a fopen() 

 
> $counter = 0;
> while ($counter <6)
> {
> fwrite($fp, $counter . "\n");

//  uhmmm... that's binary 0->5 i.e (^A->^E) izzat what you want ?
// then why the "\n" ?

try fwrite($fp, "$counter\n");

if (! fwrite(  )) {   // and shurre, you always have enuf disk space 
   ... 
}

> $counter = $counter +1; 
> } 
> fclose ($fp);

 } else {
    echo "<B>couldn't open file</B>";
 }

> ?>
> 
> Thanks for any help...
> 
> James

-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to