wilku wrote:- use [man]file[/man] to read your file to the table
- change third element of that table (this will be with index 2, as indexes are 0 based)
- join the table to string using [man]implode[/man] - first parameter= empty string, second parameter your table
- open your file for writing ([man]fopen[/man] with proper mode to truncate file to 0)
- [man]fwrite[/man] new string to opened file
I'm sorry but how can I write this?
I uso this code
$thefile= "myfile.txt";
$lines = file('myfile.txt');
foreach($lines as $line) {
}
$file = fopen($thefile,"a+");
$countplus = ($lines[2] + 1);
fclose($file);
but it it does not increase the third value ($lines[2]): where it is wrong?
@:
your code doesn't works because it adds more lines between the three values every time that page is viewed