(PECL xdiff >= 0.2.0)
xdiff_file_merge3 — 將 3 個檔案合併成一個
將三個檔案合併成一個,並將結果儲存在檔案 dest
中。 old_file
是原始版本,而 new_file1
和 new_file2
是原始檔案的修改版本。
old_file
第一個檔案的路徑。它作為「舊」檔案。
new_file1
第二個檔案的路徑。它作為 old_file
的修改版本。
new_file2
第三個檔案的路徑。它作為 old_file
的修改版本。
dest
結果檔案的路徑,包含從 new_file1
和 new_file2
合併的變更。
範例 #1 xdiff_file_merge3() 範例
以下程式碼將三個檔案合併成一個檔案。
<?php
$old_version = 'original_script.php';
$fix1 = 'script_with_fix1.php';
$fix2 = 'script_with_fix2.php';
$errors = xdiff_file_merge3($old_version, $fix1, $fix2, 'fixed_script.php');
if (is_string($errors)) {
echo "被拒絕的區塊:\n";
echo $errors;
}
?>