Jump to content

array grouping


vadim88

Recommended Posts

Let's say i have the following:

 

1 = 0

33 = 0.14

54 = 0.155

23 = 0.14

432 = 0

 

how can i make those to sort inside an array that at the end i will have an array that looks like this:

 

array (
[0] => array('rate' => 0.14, 'count' => 2, 'pids' => array([0] => 23, [1] => 33))
[1] => array('rate' => 0, 'count' => 2, 'pids' => array([0] => 1, [1] => 432))
[2] => array('rate' => 0.155, 'count' => 1, 'pids' => array([0] => 54)
)

 

Any help will be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/126152-array-grouping/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.