-2
Array ( 
    [0] => stdClass Object ( [question_id] => 5 [question_id_count] => 17 ) 
    [1] => stdClass Object ( [question_id] => 8 [question_id_count] => 15 ) 
    [2] => stdClass Object ( [question_id] => 9 [question_id_count] => 17 ) 
    [3] => stdClass Object ( [question_id] => 13 [question_id_count] => 13 ) 
    [4] => stdClass Object ( [question_id] => 14 [question_id_count] => 9 ) 
    [5] => stdClass Object ( [question_id] => 15 [question_id_count] => 13 ) 
    [6] => stdClass Object ( [question_id] => 27 [question_id_count] => 7 ) 
    [7] => stdClass Object ( [question_id] => 28 [question_id_count] => 2 ) 
    [8] => stdClass Object ( [question_id] => 29 [question_id_count] => 8 ) 
)

これは私の配列です。出力が必要です: 17 これは最高値です

4

3 に答える 3

1

これを試して:

<?php
$test = array("1" => "test", "5" => "bla", "3" => "blubb");

echo max(array_keys($test));
?>

次の解決策は次のとおりです。

$maxs = array_keys($array, max($array))

               OR

echo array_search(max($array), $array);
于 2015-12-14T05:01:45.870 に答える
0

を使用するarsort($your_array)と、最初の値が得られます。

于 2015-12-14T04:52:09.383 に答える
0
$arr = array( 10 => "AAA", 12 => "212", 17 => "SQW" );
max(array_keys($arr));

出力は次のようになります: 17

于 2015-12-14T04:56:06.370 に答える