xml - Basic fileread question in PHP / -


I have a 12 XML file, out of which I am removing a CSV file, out of which - I remove column 1 And add value to a tt.txt file.

Now, I need to extract the value from this .txt file ... this data is written all the time ... but the problem is, when I

$ Contents = fread ($ fd, filesize ($ filename));
fclose ($ fd);
$ delimiter = ','; $ Splitcontents = explosion ($ delimiter, $ content);

It reads only the first value of the IT file, every time a TTTT file is collected!

I hope to understand the problem .. what I want, I want $ content to be added only to that new data ... instead of the file every time it reads Is ...

Is there a way to get it, or what php fail? /

This problem has been extracted from the TXT file- & gt; Computations Display- & gt; Writing in a new txt file The problem is that I can not read a new value from a middle value .. PHP always reads from the beginning of a file

I think you need to store the previous file status.

Call files to get the current length, read the file later, check whether filesystems are different (or perhaps you know it in some other way, and to move the cursor to the file Use fseek to read, then read from there.

IE: $ previousLength = 0; // When you have your new reading function $ length = filesize ($ filename ) Are calling; fseek ($ fd, $ previousLength); $ content = fred ($ fd, $ length - $ last lang); $ previous l Angle = $ length;

Comments