i have a array with results. now i want to show the results in a grid in a sorted way. therefor i need to alter this array.
sort needs to be like this "order" - "pre-order" - "closed" but then i also have a "sort" value so i want to first sort on the 3 open status types and then within these types on the sort value, example array:
$arr = [
0 => ['id'=>1, 'sort'=>2, 'status'=>'closed', 'name'=>'some name...'],
1 => ['id'=>2, 'sort'=>1, 'status'=>'closed', 'name'=>'some name...'],
2 => ['id'=>3, 'sort'=>3, 'status'=>'open', 'name'=>'some name...'],
3 => ['id'=>4, 'sort'=>5, 'status'=>'pre-order', 'name'=>'some name...'],
4 => ['id'=>5, 'sort'=>4, 'status'=>'closed', 'name'=>'some name...'],
5 => ['id'=>6, 'sort'=>6, 'status'=>'pre-order', 'name'=>'some name...'],
6 => ['id'=>7, 'sort'=>7, 'status'=>'pre-order', 'name'=>'some name...'],
7 => ['id'=>8, 'sort'=>9, 'status'=>'open', 'name'=>'some name...'],
8 => ['id'=>9, 'sort'=>8, 'status'=>'open', 'name'=>'some name...'],
9 => ['id'=>10, 'sort'=>10, 'status'=>'closed', 'name'=>'some name...'],
10 => ['id'=>11, 'sort'=>11, 'status'=>'closed', 'name'=>'some name...'],
];
i dit it by several loops adding the types to a new array checking the open status, but i can not make it work with the sort.