2013-04-30 61 views
0

我有2个文件:
images1.txt
--file1
--file2
--file5
--file6
--file7
images2 .TXT
--file1
--file5
--file6
通讯,AWK替代为PHP

我需要创建文件images_to_delete.txt与预期的结果:
images_to_delete.txt
--file2
--file7

我知道我可以使用bash命令使用做到这一点:

awk 'NR==FNR{a[$0];next}!($0 in a)' images2.txt images1.txt > images_to_delete.txt 

是否有可能做到这一点在PHP中不使用了shell_exec?

谢谢。

回答