开发者

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

开发者 https://www.devze.com 2023-03-12 15:48 出处:网络
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.

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

精彩评论

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

关注公众号