I'm trying to figure out a diff function in PHP. I want to compare one string to another and show the differences. I found and tried the following, but I get nothing from it.
Code:
<?php
$old_article = 'test 123';
$new_article = 'test 456';
$diff = xdiff_string_diff($old_article, $new_article, 1);
if (is_string($diff)) {
echo "Differences between two articles:\n";
echo $diff;
}
?>