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, который является самым высоким значением
попробуй это:
<?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);
использование arsort($your_array)
, а затем вы получите первое значение.
$arr = array( 10 => "AAA", 12 => "212", 17 => "SQW" );
max(array_keys($arr));
Выход будет: 17