<?php
function Syllables($string)
{
$syllables = array
(
'dn\'t|eau|iou|ouy|you|bl$',
'ai|ae|ay|au|ea|ee|ei|eu|ey|ie|ii|io|oa|oe|oi|oo|ou|oy|ue|uy|ya|ye|yi|yo|yu',
'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:
38.94 ms | 402 KiB | 5 Q