Is there a way to get all alphabetic chars (A-Z) in an array in PHP so I can loop through them and display them?
Maybe it's a little offtopic (topic starter asked solution for A-Z only), but for cyrrilic character soltion is:
// to place letters into the array
$alphas = array();
foreach (range(chr(0xC0), chr(0xDF)) as $b) {
$alphas[] = iconv('CP1251', 'UTF-8', $b);
}
// or conver array into comma-separated string
$alphas = array_reduce($alphas, function($p, $n) {
return $p . '\'' . $n . '\',';
});
$alphas = rtrim($alphas, ',');
// echo string for testing
echo $alphas;
// or echo mb_strtolower($alphas); for lowercase letters