我的阵列:
Array
(
[0] => stdClass Object
(
[questionID] => 588
[answer] => extremely-likely
[count] => 2
[percent] => 95%
)
[1] => stdClass Object
(
[questionID] => 588
[answer] => extremely-unlikely
[count] => 2
[percent] => 95%
)
[2] => stdClass Object
(
[questionID] => 588
[answer] => likely
[count] => 1
[percent] => 48%
)
[3] => stdClass Object
(
[questionID] => 588
[answer] => neither
[count] => 1
[percent] => 48%
)
[4] => stdClass Object
(
[questionID] => 588
[answer] => unsure
[count] => 1
[percent] => 48%
)
)
我设法撤回了我想要显示的数据,但是当我遍历每个问题时,我想按特定顺序显示它们。
订单是:
非常可能
可能的
无论
不大可能
极不可能
不确定
这是因为我希望我的桌子如下所示:
但目前它看起来像这样。
有时并非所有这些问题都存在,所以如果某人没有极有可能回答,那么这将不在阵列中。在这种情况下,它需要默认为列表中的下一个。