这是一个棘手的解释..
按所需顺序排列的类别数组
Array
(
[0] => products
[1] => installation
[2] => software setup
[3] => aftecare & warranty
[4] => other
)
以及各自类别的另一组问题/答案-
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.
)
)
)
然后我需要对这个数组进行排序,以便类别与第一个数组的顺序相同。(即安装前的产品)
我尝试了array_multisort() 和usort(),multisort 抛出一个数组,数组长度不同,而usort() 需要cmp 函数返回一个整数,这让我有些难过。
感激地收到任何帮助。
谢谢