title: How to check if all characters in a string are the same?
body: <p>How to check if all characters in a string are identical, or in other words whether there are at least two different characters in a string?</p>
  
  <hr>
  
  <p>This is my non-working attempt:</p>
  
  <pre><code>&lt;?php
  $isSame = False;
  $word = '1111';//in any language
  $word_arr = array();
  for ($i=0;$i&lt;strlen($word);$i++) {
      $word_arr[] = $word[$i];
      if($word_arr[$i] == $word[$i]) $isSame = True;
  }
  var_dump($isSame);
  ?&gt;
  </code></pre>