-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsuliat.php
More file actions
55 lines (28 loc) · 686 Bytes
/
Copy pathsuliat.php
File metadata and controls
55 lines (28 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/php
<?php
$name = "Suliat Abike Jimoh";
$mail = "suliatjimoh@gmail.com";
$slack_username = "@SuliJimoh";
$twitter = "sulistical";
$biostack = "Genomics";
// PHP program to find hamming distance b/w
// two string
// function to calculate
// Hamming distance
function hammingDist($str1, $str2)
{
$i = 0; $count = 0;
while (isset($str1[$i]) != '')
{
if ($str1[$i] != $str2[$i])
$count++;
$i++;
}
return $count;
}
// Driver Code
$str1 = "@SuliJimoh";
$str2 = "sulistical";
// function call
echo "$name, $mail, $slack_username, $biostack, $twitter, " . hammingDist ($str1, $str2);
?>