$length = strlen($md5HashKey);
    $hits = substr_count($md5HashKey, $keyChar);
    $percent = $hits / $length * 100;
    return $percent;
}
//*********************************** DEEL 2 *******************************
?>

<!DOCTYPE html>
<html>
<head></head>
<body>

	<h1>DEEL 1</h1>
	
	<p><?php 
echo functie1($md5HashKey, "2");
?>
</p>
	<p><?php 
echo functie2("8");
?>
</p>
	<p><?php 
echo functie3("a");
?>
</p>


</body>
</html>
    }
    return $getal / strlen($HashKey) * 100 . "%";
}
function functie3($character)
{
    $HashKey = $GLOBALS["md5HashKey"];
    $getal = 0;
    for ($i = 0; strlen($HashKey) > $i; $i++) {
        if (substr($HashKey, $i, 1) === $character) {
            $getal++;
        }
    }
    return $getal / strlen($HashKey) * 100 . "%";
}
$boodschap1 = functie1("2");
$boodschap2 = functie2("8", $md5HashKey);
$boodschap3 = functie3("a");
?>
<html>
    <head>
        <title>gevorderde functies</title>
    </head>
    <body>
        <p><?php 
echo $boodschap1;
?>
</p>
        <p><?php 
echo $boodschap2;
?>
</p>