mam taki mały problemik

Mam taką o tablice :
( ( [id] => 18 [name] => xxx [delivelercode] => 132453 [producerid] => 1 [quantity] => 2 ) ( [id] => 7 [name] => xxx [delivelercode] => 65324 [producerid] => 1 [quantity] => 1 ) ( [id] => 14 [name] => xxxxx [delivelercode] => 98718318 [producerid] => 4 [quantity] => 1 ) ( [id] => 14 [name] => xxx [delivelercode] => 31422 [producerid] => 4 [quantity] => 1 ) )
i teraz chciałbym to posortować w taki sposób aby rekordy z producerid = 1 były w jednej tablicy a rekordy z producerid = 4 były w drugiej (dodam ze może być więcej producerid więc chodzi też o to żeby na sztywno tego nie przypisywać tylko aby robiło się to dynamiczni) tylko ni jak mi to nie wychodzi
