Created
February 12, 2019 21:45
-
-
Save joshghent/c1dd7e4d8f19174a550d2da9112f0577 to your computer and use it in GitHub Desktop.
AgedFirsthandKeyboard created by joshghent - https://repl.it/@joshghent/AgedFirsthandKeyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$string = "floccinaucinihilipilification"; | |
$characters = array_unique(str_split($string)); | |
$count = []; | |
foreach($characters as $char) { | |
$count[$char] = substr_count($string, $char); | |
} | |
// Order the array | |
arsort($count); | |
echo json_encode($count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment