hi,
maybe it's a dull question, but anybody knows how to append a string (n lenght) to the end (before the new line) of a line inside a plain text file ?
the point is that everything i've tryed just overwrites, instead of appending. if it helps, the piece of code is:
// opens the file in read/write with fp at the begining
$fh_nicks = fopen('chico.txt', 'r+');
// get a line from fp
$linea = fgets($fh_nicks, 4096);
// move -1 bites, so it positions fp just before the \n
fseek($fh_nicks, -1, SEEK_CUR);
// writes the string i want to append. here is where the problem
// shows up.
fwrite($fh_nicks, ":hola");
// puts fp at the begining of the next line
fseek($fh_nicks, 1, SEEK_CUR);
// closes the fh
fclose($fh_nicks);
thanks in advace,
oscar