Returns whether a value exists in an array.
This function returns TRUE if a specific value exists in an array.
<?php
$char = 'å';
if (in_array($char, range('a', 'z'))) {
print "$char is in the English alphabet";
} else {
print "$char is not in the English alphabet";
}
?>
å is not in the English alphabet
The code uses the range() and in_array() functions to check whether the character $char is a letter in the English alphabet.