I'm having an issue with the function str_word_count() with my PHP.
I have this piece of code:
$array_cadena = str_word_count($row[0]);
echo "<td>";
for ($i = 0; $i < $half_words; $i++) {
echo $array_cadena[$i] . " ";
};
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...
$array_cadena = str_word_count($row[0], 1,'1,2,3,4,5,6,7,8,9,0,á,é,í,ó,ú,ñ,.,;');
But in the browser, I see this error: Notice: Undefined offset:
What am I doing wrong?
Thanks for your help.