file compare
来源:互联网 发布:php开发工程师简历 编辑:程序博客网 时间:2024/06/01 22:03
<?php // file comparefunction getFile2Array($dir){ $handle = fopen($dir,'r'); if($handle){ $lines = array(); while(($buffer = fgets($handle,1024))!==false){ //$lines[] = $buffer; // delete and white character $lines[] = preg_replace('/\s/','',$buffer); } if (!feof($handle)) { echo "Error: unexpected fgets() fail\n"; } fclose($handle); return $lines; }}$file1Arr = getFile2Array('a.txt');$file2Arr = getFile2Array('b.txt');echo "diff \r\n";$diff = array_diff($file1Arr,$file2Arr);$diffStr = implode("",$diff);echo "=>a more than b:\r\n".$diffStr;echo "\r\n";$diff = array_diff($file2Arr,$file1Arr);$diffStr = implode("",$diff);echo "=>b more than a:\r\n".$diffStr;?>
阅读全文
0 0
- file compare
- Compare File and Object
- TC中Add File &amp; Compare File使用介绍
- compare
- compare
- compare:
- How to create a File-Compare function in Visual C#
- xcode 升级到4.5 version file compare功能无法使用的问题
- How to compare the differences of the same file in the two nodes
- Array::Compare, compare(), full_compare()
- Beyond Compare
- compare.cpp
- Algorithms Compare
- 比较(compare)
- EMF Compare
- Folder Compare
- QString::compare
- Beyond Compare
- 腾讯云服务器挂载云硬盘
- NSString 使用 copy 关键字和 strong 关键字修饰的异同
- Java 发送http请求 HttpURLConnection
- source insight 4 安装及使用中的问题
- 正则表达式中各种字符的含义
- file compare
- ubuntu14.04 python3.5安装工具包(个人备忘)
- linux 内核自旋锁spinlock实现详解(基于ARM处理器)
- Android开发
- LeetCode#228 Summary Ranges (week7)
- STM32F10x CPU低功耗模式之停机模式
- Java JOSN数据类型处理
- linux下vim编辑器的详讲
- ubuntu上使用screenshot自定义截图教程