【发布时间】:2013-03-03 15:01:26
【问题描述】:
我有两个文件。 file1.txt 包含:
hello
world
france
file2.txt 包含:
hello
germany
france
我想弄清楚如何才能获得 file1.txt 中不存在的单词 germany
任何语言
【问题讨论】:
-
file2中file1中缺少“world”这个词怎么办?您的问题文本与您的示例不匹配。
-
在 php 中,使用 file_get_content() 并使用 explode() 将它们转换为数组,然后使用 if-else 语句和其他进行比较
-
这适用于 PHP:stackoverflow.com/a/36226078/3179492