waplet Posted February 10, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
daGrevis Posted February 10, 2011 Report Share 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 Link to comment Share on other sites More sharing options...
waplet Posted February 10, 2011 Author Report Share 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 Link to comment Share on other sites More sharing options...
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.