Menu Riverview Church

NATCASESORT

Sort an array using a case insensitive "natural order" algorithm

SYNTAX

natcasesort ( array &$array ) : bool

PARAMETERS

array

The input array.

RETURN

Returns TRUE on success or FALSE on failure.

EXAMPLES

1

C => apple
B => Banana
d => Lemon
a => orange

2

asort:
Array
(
    [5] => IMG3.png
    [4] => IMG4.png
    [3] => img1.png
    [1] => img10.png
    [0] => img12.png
    [2] => img2.png
)
natcasesort:
Array
(
    [3] => img1.png
    [2] => img2.png
    [5] => IMG3.png
    [4] => IMG4.png
    [1] => img10.png
    [0] => img12.png
)

3

asort:
Array
(
    [4] => -1000
    [0] => -5
    [2] => -2
    [3] => 0
    [1] => 3
    [5] => 9
)
natcasesort:
Array
(
    [2] => -2
    [0] => -5
    [4] => -1000
    [3] => 0
    [1] => 3
    [5] => 9
)

PHP