title: How to loop an array with strings as indexes in PHP
body: <p>I had to make an array with as indexes A-Z (the alphabet). Each index had to have a value 0.
  So i made this array:</p>
  
  <pre><code>$alfabet = array(
  'A' =&gt; 0,
  'B' =&gt; 0,
  'C' =&gt; 0,
  'D' =&gt; 0,
  'E' =&gt; 0,
  'F' =&gt; 0,
  'G' =&gt; 0,
  'H' =&gt; 0,
  'I' =&gt; 0,
  'J' =&gt; 0,
  'K' =&gt; 0,
  'L' =&gt; 0,
  'M' =&gt; 0,
  'N' =&gt; 0,
  'O' =&gt; 0,
  'P' =&gt; 0,
  'Q' =&gt; 0,
  'R' =&gt; 0,
  'S' =&gt; 0,
  'T' =&gt; 0,
  'U' =&gt; 0,
  'V' =&gt; 0,
  'W' =&gt; 0,
  'X' =&gt; 0,
  'Y' =&gt; 0,
  'Z' =&gt; 0
  );
  </code></pre>
  
  <p>I also have got text from a file ($text = file_get_contents('tekst15.txt');)
  I have putted the chars in that file to an array: $textChars = str_split ($text);
  and sorted it from A-Z: sort($textChars);</p>
  
  <p>What i want is that (with a for loop) when he finds an A in the textChars array, the value of the other array with index A, goes up by one (so like: $alfabet[A]++;</p>
  
  <p>Can anyone help me with this loop? I have this atm:</p>
  
  <pre><code>for($i = 0; $i &lt;= count($textChars); $i++){
  
  while($textChars[$i] == $alfabet[A]){
  $alfabet[A]++;
  }
  
  
  }
  echo $alfabet[A];
  </code></pre>
  
  <p>Problem 1: i want to loop the alfabet array to, so now i only check for A but i want to check all indexes.
  Problem2: this now returns 7 for each alphabet index i try so its totally wrong :)</p>
  
  <p>I'm sorry about my english but thanks for your time.</p>