$value) { $tmp = explode(" ",$value); //print_r($tmp); if(substr(trim($tmp[2]),-1,1)=="С‡") { $who = 1; } else { $who = 2; } $nn->who = $who; $nn->firstName = trim($tmp[1]); $nn->secondName = trim($tmp[0]); $nn->doit(); $html = compare($nn->firstResult, $nn->secondResult, $cheched[$key]); if($html!=false) { //$count += 1; $html_all .= $html; } //$count_all += 1; //print_r($nn->firstResult); //echo $tmp[2]." $who
"; } echo "

Ошибок: $count / Всего: $count_all / Пробив: ".((round(($count_all-$count)/$count_all*10000))/100)."%

".$html_all; function compare($firstArray, $secondArray, $checkline) { global $names; $result = ""; $check = explode("#",$checkline); //print_r($check); $i = 0; for($i==1;$i<6;$i++) { $comp = compare_word($firstArray[$i], $secondArray[$i], trim($check[$i])); if($comp==3) { //return false; $tt = explode(" ",trim($check[$i])); $result .= "
  • $i - {$firstArray[$i]}/{$tt[1]} {$secondArray[$i]}/{$tt[0]}
  • "; } elseif($comp==2) { $tt = explode(" ",trim($check[$i])); $result .= "
  • $i - {$secondArray[$i]}/{$tt[0]}
  • "; } elseif($comp==1) { $tt = explode(" ",trim($check[$i])); $result .= "
  • $i - {$firstArray[$i]}/{$tt[1]}
  • "; } } if($result) { return "".$check[0]."
    "; } else { return false; } } function compare_word($firstStr, $secondStr, $checkStr) { global $count, $count_all; $tmp = explode(" ",$checkStr); //echo $checkStr; $nsecond = trim($tmp[0]); $nfirst = trim($tmp[1]); //echo "_{$firstStr}_{$nfirst}_
    "; $count_all += 2; if($firstStr!=$nfirst and $secondStr!=$nsecond) { $count += 2; return 3; } elseif($firstStr!=$nfirst) { $count += 1; return 1; } elseif($secondStr!=$nsecond) { $count += 1; return 2; } } //print_r($names); ?>