How do I get the number of characters in PHP?

php, string

Solution

mb_strlen($text, "UTF-8");

Problem

`mb_strlen` only gives number of bytes, and it is not what I wanted. It should work with multibyte characters.

Original source