<?php
function Syllables($string)
{
$syllables = array
(
'a|e|i|o|u|y',
);
return preg_match_all('~' . implode('|', $syllables) . '~', preg_replace('~[es]$~', '', $string));
}
$domains = array
(
'algorithmical' => 0,
'bitoriented' => 0,
'cargocultdevs' => 0,
'corecursion' => 0,
'dereferenced' => 0,
'fellowhackers' => 0,
'gosub10' => 0,
'gosubten' => 0,
'humbledeveloper' => 0,
'humbleprogrammers' => 0,
'metaprogramming' => 0,
'privatevoid' => 0,
'shiftleft1' => 0,
'stackoverflow' => 0,
'understandrecursion' => 0,
'writeoncereadmany' => 0,
);
foreach ($domains as $key => $value)
{
$domains[$key] = Syllables($value);
}
if (arsort($domains, SORT_NUMERIC) === true)
{
print_r($domains);
}
preferences:
36.71 ms | 402 KiB | 5 Q