Unable to resolve the array_diff issue
<pre><code>$j[0]='is';
$j[1]='for';
$diff = array_diff($uniqdesc, $j); 
foreach($diff as $find){

echo $find."&lt;/br&gt;";
</code></pre>

<p>$uniquedesc is an array from a string of words.
I need to print out all the uncommon words. The above code is working fine and eliminating 'is' 'for'</p>

<p>Now I stored all the common words in a text file. And I need to eliminate those common words from any string of words. </p>

<p>But the code does not seem to work. How to solve this?</p>

<pre><code>   $common = file_get_contents('commonwords.txt'); 
$commonArray = explode(" ",$common);
sort($commonArray);
$q=0;
array_unique($commonArray);
$jay=array_unique($commonArray);
foreach($jay as $k){
$j[$q]=(string)$k;
$q=$q+1;
}
$q=0;
for($q=0;$q&lt;20;$q++)
{
echo $j[$q];// This is for testing. It printed the first 20 strings correctly.
}

$diff = array_diff($uniqdesc, $j); 
foreach($diff as $find){

echo $find."&lt;/br&gt;";
</code></pre>
