Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,895 questions

51,826 answers

573 users

How to create array from all alphabetic chars upper and lower case in PHP

1 Answer

0 votes
$abc = array_merge(range('A', 'Z'), range('a', 'z'));
echo "<pre>";
print_r($abc);
echo "</pre>";

/*
run:

Array
(
    [0] => A
    [1] => B
    [2] => C
    [3] => D
    [4] => E
    [5] => F
    [6] => G
    [7] => H
    [8] => I
    [9] => J
    [10] => K
    [11] => L
    [12] => M
    [13] => N
    [14] => O
    [15] => P
    [16] => Q
    [17] => R
    [18] => S
    [19] => T
    [20] => U
    [21] => V
    [22] => W
    [23] => X
    [24] => Y
    [25] => Z
    [26] => a
    [27] => b
    [28] => c
    [29] => d
    [30] => e
    [31] => f
    [32] => g
    [33] => h
    [34] => i
    [35] => j
    [36] => k
    [37] => l
    [38] => m
    [39] => n
    [40] => o
    [41] => p
    [42] => q
    [43] => r
    [44] => s
    [45] => t
    [46] => u
    [47] => v
    [48] => w
    [49] => x
    [50] => y
    [51] => z
)

*/

 



answered Jul 21, 2018 by avibootz
...