title: How to get popular keywords in an array
body: <p>I have an array with all keywords of my site like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; keyword1
      [1] =&gt; keyword1
      [2] =&gt; keyword1
      [3] =&gt; keyword1
      [4] =&gt; keyword1
      [5] =&gt; keyword1
      [6] =&gt; keyword1
      [7] =&gt; keyword1
      [8] =&gt; keyword1
      [9] =&gt; keyword1
      [10] =&gt; keyword2
      [11] =&gt; keyword2
      [12] =&gt; keyword2
      [13] =&gt; keyword3
      [14] =&gt; keyword3
      [15] =&gt; keyword3
      [16] =&gt; keyword3
      [17] =&gt; keyword3
      [18] =&gt; keyword3
      [19] =&gt; keyword4
      [20] =&gt; keyword4
      [21] =&gt; keyword4
      [22] =&gt; keyword4
      [23] =&gt; keyword4
      [24] =&gt; keyword5
  )
  </code></pre>
  
  <p>And I want to find popular keywords, creating an array like this one:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; keyword1
              [count] =&gt; 10
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; keyword2
              [count] =&gt; 3
          )
  
      [2] =&gt; Array
          (
              [0] =&gt; keyword3
              [count] =&gt; 6
          )
  
      [3] =&gt; Array
          (
              [0] =&gt; keyword4
              [count] =&gt; 5
          )
  
      [4] =&gt; Array
          (
              [0] =&gt; keyword5
              [count] =&gt; 1
          )
  
  )
  </code></pre>
  
  <p>Also I want to sort by count of keywords and remove duplicated values and set every keyword in a sub array.</p>