Perhaps its my english but the explanation in the PHP Manual (quoted bellow) doesn't answer my question quite clearly.
To move to a position before the end-of-file, you need to pass a negative value in offset and set whence to SEEK_END.
I have a file and i need to write on its (let's say) 5th line. how should I workout the correct offset for it?
I know its not simply (5) the line number. so I'm guessing its the total length of existing data up to the beginning of 5th line. If so is there any specific length for each line of file, or (most likely) it's variable based on the line's content? and if its variable how should I find it out?
Any advise will be appreciated.