Perhaps the title didn't make much sense, but what I actually want to achieve is to sort an array by its index using an array with the sorting values:
$sortingValues = array(
'category-1',
'category-2',
...
'category-9',
);
$categories['category-1'][] = $article;
$categories['category-2'][] = $article;
...
$categories['category-9'][] = $article;
What I want to achieve is to sort $categories with the sorting values in $sortingValues.