title: PHP: Most frequent value in array
body: <p>So I have this JSON Array:</p>
  
  <pre><code>[0] =&gt; 238
  [1] =&gt; 7
  [2] =&gt; 86
  [3] =&gt; 79
  [4] =&gt; 55
  [5] =&gt; 92
  [6] =&gt; 55
  [7] =&gt; 7
  [8] =&gt; 254
  [9] =&gt; 9
  [10] =&gt; 75
  [11] =&gt; 238
  [12] =&gt; 89
  [13] =&gt; 238
  </code></pre>
  
  <p>I will be having more values in the actual JSON file. But by looking at this I can see that 238 and 55 is being repeated more than any other number. What I want to do is get the top 5 most repeated values in the array and store them in a new PHP array. </p>