Re: Problem writting to file...
| From: | James Bartlett | Date: | Fri, 06 Jul 2001 18:47:39 +0000 |
| Subject: | Re: Problem writting to file... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56553@lists.php.net to get a copy of this message | ||
I get the same result...
----- Original Message -----
From: Jerry Lake
To: php-general@lists.php.net
Sent: Friday, July 06, 2001 7:48 PM
Subject: RE: [PHP] Problem writting to file...
try this
<?php
$fp = fopen("./data.txt", "w+");
$counter = 0;
while ($counter < 6)
{
$counter++;
fwrite($fp, $counter . "\n");
}
fclose ($fp);
?>
Jerry Lake
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
-----Original Message-----
From: James Bartlett [mailto:zotud@btinternet.com]
Sent: Friday, July 06, 2001 11:30 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Problem writting to file...
No errors at all...
----- Original Message -----
From: Tyler Longren
To: php-general ; James Bartlett
Sent: Friday, July 06, 2001 7:29 PM
Subject: Re: [PHP] Problem writting to file...
Any errors being given to you?
Tyler
----- Original Message -----
From: "James Bartlett" <zotud@btinternet.com>
To: <php-general@lists.php.net>
Sent: Friday, July 06, 2001 1:15 PM
Subject: [PHP] Problem writting to file...
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+");
$counter = 0;
while ($counter <6)
{
fwrite($fp, $counter . "\n");
$counter = $counter +1;
}
fclose ($fp);
?>
Thanks for any help...
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net