Need every permutation of capitalized letters in php
<p>I want to build an array in php that contains every possible capitalization permutation of a word. so it would be (pseudocode)</p>

<pre><code>function permutate($word){
  for ($i=0; $i&lt;count($word); $i++){
    ...confused here...
    array_push($myArray, $newWord)   
  }
  return $myArray;
}
</code></pre>

<p>So say I put in "School" I should get an array back of</p>

<p>{school, School, sChool, SCHool, schOOl, ... SCHOOL}</p>

<p>I know of functions that capitalize the string or the first character, but I am really struggling with how to accomplish this.</p>
