BC Array Sort

UNIX name Owner Status
bcarraysort Brookins Consulting stable
Version Compatible with
1.0.0 4.0+
The BC Array Sort operator extension which is compatible with eZ Publish 4.0+ and PHP 5.0+

This extension provides wrapper for PHP array sort functions:
sort(), rsort(), asort(), arsort(), ksort(), krsort(), natsort(), and natcasesort().
Also the optional sort_flags parameter is also implemented (as string).

Read More: http://www.php.net/manual/en/ref.array.php

Brookins Consulting is proud to announce the release of the array sort operator!

Downloads

Version 1.0.0

Subversion

This branch of the operator is eZ Publish 4.0+ and PHP5+ Compatible

Example
ArraySortOperator
=================

Wrapper for PHP array sort functions:

sort([$flags])
rsort([$flags])
asort([$flags])
arsort([$flags])
ksort([$flags])
krsort([$flags])

natsort()
natcasesort()

Except for the last two operators, there is an optional argument of type string, which can be either 'regular', 'numeric', 'string', or 'locale_string'.
See also: http://www.php.net/manual/en/ref.array.php

Example:
{def $array = array('zero', 'one', 'two')}
{*
$array = Array(
0 => 'zero',
1 => 'one',
2 => 'two',
)
*}

{def $sorted = $array|sort('string')}
{*
sort reorders keys:
$sorted = Array(
0 => 'one',
1 => 'two',
2 => 'zero',
)
*}

{def $asorted = $array|asort('string')}
{*
asort preserves keys:
$asorted = Array(
1 => 'one',
2 => 'two',
0 => 'zero',
)
*}
Based On
Similar

No news yet.

This project has no reviews yet. Be the first one to review it!

No forum messages yet.