Search found 2 matches

by robbrown
Wed Oct 20, 2004 2:29 pm
Forum: PHP - Code
Topic: Grouping an Array
Replies: 3
Views: 259

That's what I was thinking too. But it just seems to be sorting the array. Here's the code I'm using. There must be a problem with it, but I'm having trouble finding it. Any ideas? function cmp_groups($a, $b) { if ($a < $b) return -1; if ($a > $b) return 1; return 0; } usort($output, "cmp_group...
by robbrown
Wed Oct 20, 2004 1:01 pm
Forum: PHP - Code
Topic: Grouping an Array
Replies: 3
Views: 259

Grouping an Array

I have an array &#1111;0] => 1 &#1111;1] => B &#1111;2] => NameOne &#1111;0] => 2 &#1111;1] => C &#1111;2] => NameTwo &#1111;0] => 2 &#1111;1] => A &#1111;2] => NameThree &#1111;0] => 2 &#1111;1] => B &#1111;2] => NameFour I would like to group all of ...