Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sort array

0 views
Skip to first unread message

mill...@gmail.com

unread,
Feb 24, 2007, 4:22:21 PM2/24/07
to
i got 2 array one holds the actual data n another is user generated
sort order... how to sort array #1 according to array #2???? array
shld be sorted according to sortorder

Array #1
(
[0] => Array
(
[id] => 1
[sortorder] => 2
[name] => Windows XP
)

[1] => Array
(
[id] => 2
[sortorder] => 1
[name] => Windows Vista
)

[2] => Array
(
[id] => 3
[sortorder] => 4
[name] => Mac OSX
)

[3] => Array
(
[id] => 4
[sortorder] =>3
[name] => Linux
)

)


Array #2
(
[0] => Array
(
[sortorder] => 2
)

[1] => Array
(
[sortorder] => 1
)

[2] => Array
(
[sortorder] => 4
)

[3] => Array
(
[sortorder] => 3
)

)

Hendri Kurniawan

unread,
Feb 25, 2007, 4:04:09 PM2/25/07
to
array_multisort (http://au3.php.net/manual/en/function.array-multisort.php)

Hendri Kurniawan

mill...@gmail.com wrote:
> i got 2 array one holds the actual data n another is user generated
> sort order... how to sort array #1 according to array #2???? array
> shld be sorted according to sortorder
>
> Array #1
> (
> [0] => Array
> (
> [id] => 1
> [sortorder] => 2
> [name] => Windows XP
> )
>

> )
>
>
> Array #2
> (
> [0] => Array
> (
> [sortorder] => 2
> )

> )
>

0 new messages