waplet Posted February 10, 2011 Report Posted February 10, 2011 Kā varētu uztaisīt, lai šī count funkcija strādā UTF 8 režīmā? Vai ir kādi ieteikumi kā pats varētu uztaisīt? http://www.php.net/manual/en/function.count-chars.php Quote
daGrevis Posted February 10, 2011 Report Posted February 10, 2011 Iz php.net, tā pati lapa: function utf8_count_strings($stringChar) { $num = -1; $lenStringChar = strlen($stringChar); for ($lastPosition = 0; $lastPosition !== false; $lastPosition = strpos($textSnippet, $stringChar, $lastPosition + $lenStringChar)) { $num++; } return $num; } Quote
waplet Posted February 10, 2011 Author Report Posted February 10, 2011 Doh :D es jau sen to visu izpētīju, man vajag tieši unikālos burtus, , tākāir MODE 1 tajā count_chars() funkcijā. un šis noteikti man neder. ;) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.