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?
All good answers, in case someone is looking for an array of lower and upper case alphabets, here it is:
$alpha = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
If you need an array that has alphabetical keys as well as elements (for an alphabetical dropdown list, for example), you could do this:
$alphas = array_combine(range('A','Z'),range('A','Z'))
Yields:
array (size=26)
'A' => string 'A' (length=1)
'B' => string 'B' (length=1)
'C' => string 'C' (length=1)
'D' => string 'D' (length=1)
...etc