how can I count all characters? I am selecting a field from mysql (which is a plain text) and I would like to count all letters in that text that is extracted (including spaces and all special characters).
I am comparing the value with a number, for example:
If text has more than 1000 characters then $var++
so I know how many fields have more than 1000 characters.
strlen does not seems to be counting right.
This probably happens because of encoding issues. This has nothing to do with
regexs.You can use
mb_strlento get the correct length.