Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am able to read in the last line of the text file, whose lines are of varying length, via:Code: Select all
$linecontent = " ";
$contents = file("hit_counter.txt");
$linenumber = sizeof("hit_counter.txt")+1;
$linecontent = $contents[$linenumber];I assume I can append a new line with:
Code: Select all
$handle = fopen($file,"a");I assume I could use 'fseek ($file,-offset, SEEK_END )' but how far back do I move it?
Strlen returns the length of the string, but fseek wants an offset in bytes.
Thanks,
Charlie
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]