title: Count similar values in php array of array and add unique in a new array
body: <p>I've got problems with some algo on a php array. Here is a kind of example of what I get after a grep on several logs files and store it in an array. It can be longer, each element is the result of a grep depending of the number of logs file in folder).</p>
  
  <pre><code>(
      [0] =&gt; Array
          (
              [0] =&gt; : [POST] /api_v2/resources/new_service_indexes
  
              [1] =&gt; : [POST] /api_v2/resources/new_service_tree_categories
  
              [2] =&gt; : [POST] /api_v2/users/add_device
  
              [3] =&gt; : [POST] /api_v2/users/check_email
  
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; : [GET] /api_v2/resources/categories
  
              [1] =&gt; : [POST] /api_v2/resources/new_service_indexes
  
              [2] =&gt; : [POST] /api_v2/resources/new_service_tree_categories
  
              [3] =&gt; : [POST] /api_v2/users/add_device
  
              [4] =&gt; : [POST] /api_v2/users/check_email
  
              [5] =&gt; : [POST] /api_v2/users/facebook_login
  
              [6] =&gt; : [POST] /api_v2/users/login
  
              [7] =&gt; : [POST] /api_v2/users/register
  
  
          )
  
      [2] =&gt; Array
          (
              [0] =&gt; : [POST] /api_v2/resources/new_service_indexes
  
              [1] =&gt; : [POST] /api_v2/resources/new_service_tree_categories
  
              [2] =&gt; : [POST] /api_v2/users/add_device
  
              [3] =&gt; : [POST] /api_v2/users/facebook_login
  
              [4] =&gt; : [POST] /api_v2/users/login
  
          )
  )
  </code></pre>
  
  <p>I want to count all key occurrences before deleting them and get a new array where there is unique key and the count.  Example: </p>
  
  <pre><code>        (
              [name] =&gt; : [GET] /api_v2/resources/categories
              [count] =&gt; : 2
  
              [name] =&gt; : [POST] /api_v2/resources/new_service_indexes
              [count] =&gt; : 3
  
              [name] =&gt; : [POST] /api_v2/resources/new_service_tree_categories
              [count] =&gt; : 5
  
              [name] =&gt; : [POST] /api_v2/users/add_device
              [count] =&gt; : 2 
  
              [name] =&gt; : [POST] /api_v2/users/check_email
              [count] =&gt; : 2
  
              [name] =&gt; : [POST] /api_v2/users/facebook_login
              [count] =&gt; : 6
  
              [name] =&gt; : [POST] /api_v2/users/login
              [count] =&gt; : 2
  
              [name] =&gt; : [POST] /api_v2/users/register
              [count] =&gt; : 2
  
          )
  
  </code></pre>