This is a tricky one to explain..
Array of categories which are in the required order
Array
(
[0] => products
[1] => installation
[2] => software setup
[3] => aftecare & warranty
[4] => other
)
and another array of questions/answers with their respective category -
Array
(
[installation] => Array
(
[0] => Array
(
[question] => Third FAQ
[answer] => Another sample FAQ question
)
)
[products] => Array
(
[0] => Array
(
[question] => Another FAQ
[answer] => This is a sample FAQ answer.
)
)
)
Then I need to sort this array so that the categories are in the same order as the first array. (ie products before installation)
I've attempted array_multisort() and usort(), multisort throws an array about array lengths being different and usort() requires the cmp function to return a integer, which stumped me somewhat.
Any help gratefully received.
Thank you