Skip to content
Advertisement

Tag: sorting

output common int using array_search

I am trying to create a function that will output the smallest common int or return false if there is not one in three arrays. The arrays are sorted ascending and I want to do with array_search. When I execute this code it returns nothing and I don’t know why it should echo 5 I think Answer Here is a

Sort array by 2nd level array count

I have an array that looks like this: I need to be able to count the 2nd level contents and then sort the top level arrays based on these totals. So for example my resultant array would look something like this: I then ideally want to sort by descending order and show only the top 5 results. At present my

Advertisement