title: Notice: undefined offset with str_word_count
body: <p>I'm having an issue with the function <strong>str_word_count()</strong> with my PHP.</p>
  
  <p>I have this piece of code:</p>
  
  <pre><code>$array_cadena = str_word_count($row[0]);
  echo "&lt;td&gt;";
  for ($i = 0; $i &lt; $half_words; $i++) {
      echo $array_cadena[$i] . " ";
  };
  </code></pre>
  
  <p>It works without problems, but if I leave the code like that I'll experience problems with the accents, punctuation marks and numbers. So I decided to add the following...</p>
  
  <pre><code>$array_cadena = str_word_count($row[0], 1,'1,2,3,4,5,6,7,8,9,0,á,é,í,ó,ú,ñ,.,;');
  </code></pre>
  
  <p>But in the browser, I see this error:
  Notice: Undefined offset:</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks for your help.</p>