2010/11/23 రహ్మానుద్దీన్ షేక్ <[email protected]>: > I have this code in php to read the length of a string in utf-8, > > <?php > header("Content-Type: text/html; charset=utf-8"); > $a = "தமிள்"; > $c = strlen(utf8_decode($a)); > echo "The string input: ".$a." and its length:".$c; > ?> > > But it returns out put as : The string input: தமிள் and its length:5 > Now I want to have the out put as 3 but not as 5, how to achieve that? >
You need to use multi byte string functions. Please refer to http://www.php.net/manual/en/intro.mbstring.php Note the User contributed note by Ant P for enabling mbstring functions in your existing code. Hope this helps. Ma Sivakumar கணிப்பொருள் - http://kaniporul.blogspot.com/ தமிழில் ஐலக்சி - http://www.ae.iitm.ac.in/mailman/listinfo/ilugc.tamil _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
