To get key values of an array,array_keys can be used. <?php $ranges=array( 'A-B'=>range('A','B'), 'C-D'=>range('C','D'), 'E-F'=>range('E','F'), 'G-H'=>range('G','H'), 'I-J'=>range('I','J'), 'K-L'=>range('K','L'), 'M-N'=>range('M','N'), 'O-R'=>range('O','R'), 'S-T'=>range('S','T'), 'U-Z'=>range('U','Z') ); $alpharange = array_keys($ranges); print_r($alpharange); ?>