title: getting max array count
body: <p>Hi need help getting repeated value from give array,below is the code which im trying get max values of <code>$values[4]</code></p>
  
  <pre><code>$values = array(
      "0"=&gt; "abc",
      "1"=&gt; "aaa",
      "2"=&gt; "aaa|abc",
      "3" =&gt;  "| | | | | | | | | | | | | | | | ",
      "4" =&gt; "a|b|b|c|d|e|f|g",
      "5" =&gt; "1|2|3||4|5|6"
  );
  
  
  foreach ($values as $key) {
  $prevalues = explode('|', $key);
  $count[] = count($prevalues);
  }
   print_r($counts);
   $counts = array_count_values($count);
   arsort($counts);
   echo $max= key($counts);
  
  
  Array
   (
      [0] =&gt; 1
      [1] =&gt; 1
      [2] =&gt; 2
      [3] =&gt; 17
      [4] =&gt; 8
      [5] =&gt; 8
  )
  print_r($max );
  </code></pre>
  
  <p>Currently, I am getting $max = 1; I need $max to be 8.</p>