<?php $tests = [ "Bright vixens jump; dozy owl quack.", "zyra nymph, quid vex jock, fblg wt", "Amazingly few discotheques provide jukeboxes", "ANFZB ZIQBB SNYQ YWAHT", "pack my box with five dozen liquor jugs!!", "Mr Jock, TV quiz PhD, bags few lynx.", ]; $perfection = array_fill_keys(range(97, 122), 1); $non = $pan = $perf = 0; foreach ($tests as $test) { $counts = array_intersect_key( count_chars(strtolower($test), 1), $perfection ); // var_dump($perfection, '-', $counts, '==='); if ($perfection === $counts) { ++$perf; } elseif (count($counts) != 26) { ++$non; } else { ++$pan; } } var_dump($non, $pan, $perf);
You have javascript disabled. You will not be able to edit any code.