2013-04-30 60 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?

謝謝。

回答