Re: [PHP4BETA] re:Incremnting a number in a file
| From: | Joseph H Blythe | Date: | Fri, 04 Feb 2000 06:39:09 +0000 |
| Subject: | Re: [PHP4BETA] re:Incremnting a number in a file | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-9786@lists.php.net to get a copy of this message | ||
Evan Klinger wrote:
> The mode "w+" does indeed open the file for reading and writing;
> however, it truncates the file if it already exists and positions the
> stream at the beginning of the file. You would want to use mode "r+"
> which opens for reading and writing but does not truncate the file.
Doh! I didn't even think of that he he, but this still does not do what I
intended I want to read the value 0 and increment it by one every time so it
would go 0, 1 , 2, 3 etc... not so it appends it to the end of the number, if
I use the w+ it still equals NULL?
thanks.
Joseph H Blythe
Boldweb Internet / Binary Logic
257 Churchill Road Prospect,
Adelaide South Australia 5082
PH: 08 8342 0022
FAX: 08 8342 0155
mailto:webdevel@binarylogic.com.au