The Cyrillic Character Problem in PHP
The strlen function, like many other
PHP string functions, does not work correctly
with Cyrillic characters - it counts
each Cyrillic letter twice:
<?php
echo strlen('абвгд'); // will output 10, not 5
?>
Therefore, for strings that contain or potentially
may contain problematic characters, use the
mb_strlen function - it will work
correctly:
<?php
echo mb_strlen('абвгд'); // will output 5
?>
Assign a Cyrillic string to a variable. Display the length of your string on the screen.