DiffMatchPatch\DiffTest::rebuildtexts PHP Method

rebuildtexts() public method

public rebuildtexts ( $diffs )
        function rebuildtexts($diffs)
        {
            // Construct the two texts which made up the diff originally.
            $text1 = "";
            $text2 = "";
            foreach ($diffs as $change) {
                if ($change[0] != Diff::INSERT) {
                    $text1 .= $change[1];
                }
                if ($change[0] != Diff::DELETE) {
                    $text2 .= $change[1];
                }
            }
            return array($text1, $text2);
        }