title: How to count the inner array count too
body: <p>I have an array like as</p>
  
  <pre><code>$arr[0] = 'summary';
  $arr[1]['contact'][] = 'address1';
  $arr[1]['contact'][] = 'address2';
  $arr[1]['contact'][] = 'country';
  $arr[1]['contact'][] = 'city';
  $arr[1]['contact'][] = 'pincode';
  $arr[1]['contact'][] = 'phone_no';
  $arr[2]['work'][] = 'address1';
  $arr[2]['work'][] = 'address2';
  $arr[2]['work'][] = 'country';
  $arr[2]['work'][] = 'city';
  $arr[2]['work'][] = 'pincode';
  $arr[2]['work'][] = 'phone_no';
  </code></pre>
  
  <p>Using <code>count($arr)</code> it returns <code>3</code> but I also need to count inner array values so it will return <code>13</code></p>
  
  <p>What I've tried so far is</p>
  
  <pre><code>function getCount($arr,$count = 0) {
  
      foreach ($arr as $value) {
  
          if (is_array($value)) {
              echo $count;
              getCount($value,$count);
          }
          $count = $count+1;
      }
      return $count;
  }
  
  echo getCount($arr);
  </code></pre>
  
  <p>But its not working as expected</p>