Page 1 of 1

Adding variables

Posted: Wed Apr 11, 2007 10:00 pm
by ChessclubFriend
How do I do,

$votes=fopen("votes.txt", "r");

where inside votes.txt is just the number 1.

and then,

$votes++;

so that $votes becomes 2. When I do $votes++ it messes up

Posted: Wed Apr 11, 2007 10:30 pm
by aaronhall
fopen() returns a file resource to be used be other related functions. See file_get_contents().

Posted: Wed Apr 11, 2007 10:46 pm
by ChessclubFriend
Thank you very much!