fork(2) download
  1. <?php
  2.  
  3. $c64 = str_split(
  4. 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  5. );
  6.  
  7. $sortFunction = function($x, $y) {
  8. $x = !ctype_digit($x) << 9 | !ctype_punct($x) << 8 | ord($x);
  9. $y = !ctype_digit($y) << 9 | !ctype_punct($y) << 8 | ord($y);
  10. return $x - $y;
  11. };
  12.  
  13. usort($c64, $sortFunction);
  14.  
  15. print_r($c64);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 0
    [1] => 1
    [2] => 2
    [3] => 3
    [4] => 4
    [5] => 5
    [6] => 6
    [7] => 7
    [8] => 8
    [9] => 9
    [10] => +
    [11] => /
    [12] => A
    [13] => B
    [14] => C
    [15] => D
    [16] => E
    [17] => F
    [18] => G
    [19] => H
    [20] => I
    [21] => J
    [22] => K
    [23] => L
    [24] => M
    [25] => N
    [26] => O
    [27] => P
    [28] => Q
    [29] => R
    [30] => S
    [31] => T
    [32] => U
    [33] => V
    [34] => W
    [35] => X
    [36] => Y
    [37] => Z
    [38] => a
    [39] => b
    [40] => c
    [41] => d
    [42] => e
    [43] => f
    [44] => g
    [45] => h
    [46] => i
    [47] => j
    [48] => k
    [49] => l
    [50] => m
    [51] => n
    [52] => o
    [53] => p
    [54] => q
    [55] => r
    [56] => s
    [57] => t
    [58] => u
    [59] => v
    [60] => w
    [61] => x
    [62] => y
    [63] => z
)