You are here: Sort array without index « PHP Programming Language « IT news, forums, messages
Sort array without index

Posted by christiang on 02/07/06 01:47

Hi guys I'd like to sort a multidimensional array that hasn't numerical
index, in fact it is like:

Array
(
[mobile] => Array
(
[name_str] => mobile
[relationCount_int] => 1
)

[video] => Array
(
[name_str] => video
[relationCount_int] => 2
)

[flash] => Array
(
[name_str] => flash
[relationCount_int] => 1
)

[tool] => Array
(
[name_str] => tool
[relationCount_int] => 1
)

)

And I'd like to sort, for instance for the value of
"relationCount_int", so the new order should be something like:

Array
(
[video] => Array
(
[name_str] => video
[relationCount_int] => 2
)
[mobile] => Array
(
[name_str] => mobile
[relationCount_int] => 1
)


[flash] => Array
(
[name_str] => flash
[relationCount_int] => 1
)

[tool] => Array
(
[name_str] => tool
[relationCount_int] => 1
)

)

Any idea? I tried some script I found on php.net but didn't work. The
could should run inside a class method.

Thanks a lot, chr

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация