सही लंबाई प्राप्त करने के लिए, यूनिकोड कैरेक्टर्स के लिए mb_strlen() का उपयोग करें।
PHP कोड इस प्रकार है:
उदाहरण
<?php
$unicodeValues = 'JohnSmȉth';
echo "The string length with mb_strlen=",mb_strlen($unicodeValues, 'utf8');
echo "\n";
echo "The string length with strlen=",strlen($unicodeValues);
?>
आउटपुट
The string length with mb_strlen=9 The string length with strlen=10