function isStringPangram($str) {
// array_fill(int $start_index, int $count, mixed $value): array
$letters = array_fill(0, 26, 0);
$size = strlen($str);
for ($i = 0; $i < $size; $i++) {
if (ctype_upper($str[$i])) {
$letters[ ord($str[$i]) - ord('A') ]++;
}
else if (ctype_lower($str[$i])) {
$letters[ ord($str[$i]) - ord('a') ]++;
}
}
for ($i = 0; $i < 26; $i++) {
if ($letters[$i] == 0)
return false;
}
return true;
}
$str = "The quick brown fox jumps over the lazy dog";
if (isStringPangram($str) == true)
echo "string is a Pangram";
else
echo "string is not a Pangram";
/*
run:
string is a Pangram
*/