Answer the question
In order to leave comments, you need to log in
Php how to write this algorithm?
There is an array:
Array
(
[2] => 1
[4] => 3
[5] => 1
[1] => 2
)
Array
(
[2] => 1
[4] => 3
[5] => 1
[1] => 2
)
Array
(
[2] => 1
[4] => 3
[5] => 3
[1] => 2
)
Answer the question
In order to leave comments, you need to log in
First, find the maximum value using the max function , then you can use the array_keys function with the search_value parameter (the found value through max), as a result, you will get an array of keys with the found value, and finally, the count function
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question