function match($name1, $name2) {
$num1 = 0;
$num2 = 0;
$base = array("
;0"
; =>
; 0, "
;1"
; =>
; 1, "
;2"
; =>
; 2, "
;3"
; =>
; 3, "
;4"
; =>
; 4, "
;5"
; =>
; 5, "
;6"
; =>
; 6, "
;7"
; =>
; 7, "
;8"
; =>
; 8, "
;9"
; =>
; 9, "
;a
"
; =>
; 10, "
;b
"
; =>
; 11, "
;c
"
; =>
; 12, "
;d
"
; =>
; 13, "
;e
"
; =>
; 14, "
;f
"
; =>
; 15);
for($i = 0; $i < 32; $i++) {
$value = $base[substr($md1, $i, 1)];
$num1 += $value;
}
for($j = 0; $j < 32; $j++) {
$value = $base[substr($md2, $j, 1)];
$num2 += $value;
}
}
echo "Совместимость: <strong>" . match("Саша", "Маша") . "</strong>";