开发者

PHP : check variables line by line in text file and store unique variables

I store my variables in text file.Next I get another vars, they most store in text file if they arent duplicate and old data must be clear. Check each new vars by vars stored in file. and only store unique vars.

for example first I have:

hello
begin开发者_JAVA百科
start
all page
thanks

in text file and I get new vars :

buy
have
start
animate
hello

finally stored vars in text file must be: buy have animate

(ignored start & hello)

THXA


This is for file handling.

$myFile = "testFile1.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);

Now, perform your comparison between the the data sets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜