<?php
$questionsets = array(
"A" => array("category" => "Some Category A", "score" => 0),
"B" => array("category" => "Some Category B", "score" => 29),
"C" => array("category" => "Some Category C", "score" => 12),
"D" => array("category" => "Some Category D", "score" => 88),
"E" => array("category" => "Some Category E", "score" => 4),
"F" => array("category" => "Some Category F", "score" => 22),
"G" => array("category" => "Some Category G", "score" => 20),
"H" => array("category" => "Some Category H", "score" => 40),
"I" => array("category" => "Some Category I", "score" => 42)
);
usort($questionsets,function($a,$b){return $b['score']-$a['score'];});
print_r($questionsets);
- Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
- Array
(
[0] => Array
(
[category] => Some Category D
[score] => 88
)
[1] => Array
(
[category] => Some Category I
[score] => 42
)
[2] => Array
(
[category] => Some Category H
[score] => 40
)
[3] => Array
(
[category] => Some Category B
[score] => 29
)
[4] => Array
(
[category] => Some Category F
[score] => 22
)
[5] => Array
(
[category] => Some Category G
[score] => 20
)
[6] => Array
(
[category] => Some Category C
[score] => 12
)
[7] => Array
(
[category] => Some Category E
[score] => 4
)
[8] => Array
(
[category] => Some Category A
[score] => 0
)
)
- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
- Parse error: syntax error, unexpected T_FUNCTION in /in/dsep9 on line 15
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected T_FUNCTION in /in/dsep9 on line 15
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/dsep9 on line 15
Process exited with code 255.
preferences:
163.5 ms | 410 KiB | 5 Q