title: First-letter capitalization fails when touching ampersand
body: <p>I have the following PHP function which works well in almost all cases:</p>
  <pre><code>function NormalizeWords($str, $disallowAllUppercase = false){
      $parts = explode(' ', $str);
  
      if($disallowAllUppercase){
          $result = array_map(function($x){
              return ucwords(strtolower($x));
          }, $parts);
      }else{
          $result = array_map(function($x){
              if (!ctype_upper($x)) {
                  return ucwords(strtolower($x));
              }
              return $x;
          }, $parts);
      }
      
      return implode(' ', $result);
  }
  </code></pre>
  <p>But here's a case where it misses the mark:</p>
  <pre><code>$testinput = &quot;M&amp;S ACME BUSINESS&quot;;
  $testoutput = NormalizeWords($testinput);
  die($testoutput);
  
  Expected result: M&amp;S ACME BUSINESS
  Actual result: M&amp;s ACME BUSINESS
  </code></pre>
  <p>The <code>s</code> goes to lowercase.</p>
  <p>As you can see, <code>$disallowAllUppercase</code> remains false, so any upper-case characters should be left alone.</p>
  <p>Here are a few examples of expected results:</p>
  <pre><code>&quot;THIS IS MY BUSINESS NAME&quot; ($disallowAllUppercase is true) - should be: &quot;This Is My Business Name&quot;
  &quot;THIS IS MY BUSINESS NAME&quot; ($disallowAllUppercase is false) - should be: &quot;THIS IS MY BUSINESS NAME&quot;
  &quot;aNotheR BUSINESS nAME&quot; ($disallowAllUppercase is true) - should be: &quot;Another Business Name&quot;
  &quot;aNotheR BUSINESS nAME&quot; ($disallowAllUppercase is false) - should be: &quot;Another BUSINESS Name&quot;
  </code></pre>
  <p>How can I change my function to achieve that result?</p>