• PHP Video Tutorials

PHP - xdiff file_merge3() Function



xdiff_file_merge3() function can merge three files into one.

Syntax

mixed xdiff_file_merge3( string $old_file , string $new_file1 , string $new_file2 , string $dest )

xdiff_file_merge3() function can merge three files into one and store the result in a file dest. The old_file is an original version, while new_file1 and new_file2 have modified versions of an original.

xdiff_file_merge3() function can return true if the merge is successful, string with rejected chunks if it is not, or false if an internal error occurred.

Example

<?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 "Rejects:\n";
      echo $errors;
   }
?>
php_function_reference.htm
Advertisements