Is every letter in the alphabet in a string at least once?

Viewed 593

Was wondering if there was a more efficient way to detect if a string contains every letter in the alphabet one or more times using regex?

I appreciate any suggestions

$str = str_split(strtolower('We promptly judged antique ivory buckles for the next prize'));

$az = str_split('abcdefghijklmnopqrstuvwxyz');

$count = 0;
foreach($az as $alph) {
    foreach($str as $z) {
        if($alph == $z) {
           $count++;
            break;
        }
    }
}
5 Answers
Related