title: count the occurrences of all the letters in a string PHP
body: <p>I want to count the frequency of occurrences of all the letters in a string. Say I have  </p>
  
  <pre><code>$str = "cdcdcdcdeeeef";
  </code></pre>
  
  <p>I can use str_split and array_count_values to achieve this. </p>
  
  <pre><code>array_count_values(str_split($str));
  </code></pre>
  
  <p>Wondering if there is another way to do this without converting the string to an array? Thanks</p>