I have a counter sort of in a file that I need to increment by 1 everytime. I read the current counter with fgets, but when I go to increment it does a combination of adding and concatenation.
code...
.........................
$file = fopen("myfile.txt","r+")
while (!feof ($file)) {
$id = fgets($file, 4096);
}
$id = 1 + $id; // I tried all variations...
echo $id
...........................
If $ id was 12, it will echo 1213, then 12131214, etc...fun but not useful. How can I force this to be a number? or is there better way to do this whole counter increment thingy.
Thanks
Jadow