String difference php
<p>I want to create a method which compares two sentence and returns the words that makes them different.</p>

<p>e.g </p>

<p>grey tiles 100 X 200 kitchen flooring</p>

<p>grey tiles 300 X 600 kitchen flooring</p>

<p>difference are
100 x 200
300 x 600</p>

<p>it will allow one single word (not necesary one character to sit between two unique words)
though if the distance exceeds by one it will throw an error saying the phrases are not similar enough
the difference can be found at the start/ end /  middle  of the text</p>

<p>after passing to different blogs, i found similar approach to my concern using the native php function xdiff_string_diff but the problem is, I cant make the code works. I got error saying xdiff_string_diff is undefined function.
Anyone of you knows what extensions should be loaded to make this function available?
Or if you can suggest another approach it will be great and much appreciated. :)</p>

<pre><code>&lt;?php
$old_article = "grey tiles 100 X 200 kitchen flooring";
$new_article = "grey tiles 300 X 600 kitchen flooring"

$diff = xdiff_string_diff($old_article, $new_article, 1);
if (is_string($diff)) {
    echo "Differences between two articles:\n";
    echo $diff;
}

?&gt;
</code></pre>
