Just a quick question monks. I'v been trying this code for a while to count the number of identical elements in the arrays and it keeps returning a number 1 greater then the array length? If I was to test 2 arrays of 10 elements each I get 11 even if only 1 was similar. The arrays contain string elements.
$MatchCount = 0;
for ($z=0;$z<=$arrLenA;$z++){
for ($i=0;$i<=$arrLenB;$i++){
if ($sentencesA[$z] eq $setencesB{$i}){
$MatchCount++;
}
}
}
print $MatchCount;