Detecting arrays with enough entries in common
This testing routine runs three to four times faster on the test data:

function testing($dataArray,$source,$limit)
{
  $matchesFound = 0;
  foreach ($dataArray as $data)
  {
    $counter = 0;
    foreach ($data as $number)
    {
      if (!in_array($number,$source)) $counter++;
      if ($counter == 2) break;
    }
    if ($counter == 1) $matchesFound++;
    if ($matchesFound &gt;= $limit) return implode("-", $source);
  }
  return "x";
}


A big assumption is that $dataArray only contains arrays of 6 numbers and you will always look for 5 matching numbers.

The improvement is that I stop looping as soon as I know whether there is a match or not. You simply loop over all the data. So the real speed improvement depends heavily on the data. My guess is that it can perform even better on the complete data set.

More can probably be gained if your question was more informative.