Авторизация
 Регистрация   Войти   Забыли пароль? 

utf8_cp1251_strlen Функция считает количество символов в строке в русской кодировке UTF8

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / PHP-functions for text / utf8_cp1251_strlen Функция считает количество символов в строке в русской кодировке UTF8


 Russian

utf8_cp1251_strlen The function counts the number of characters in the string in the Russian encoding UTF8

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / PHP-functions for text / utf8_cp1251_strlen The function counts the number of characters in the string in the Russian encoding UTF8


 English

PHP

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 20

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 21

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\search_bbcode_include.php on line 39
PHP
  1. <?php
  2. // RU:
  3. // функция конвертирует строку в win1251 и затем правильно считает количество символов и пробелов в строке.
  4. // EN:
  5. // function converts a string to win1251 and then correctly counts the number of characters and spaces in the string.
  6. function utf8_cp1251_strlen($text="") {
  7.     $text = iconv("UTF-8", "CP1251", $text);
  8.      return strlen($text);
  9. }
  10. ?>
Добавить комментарий

Добавить комментарий
Пожалуйста, залогиньтесь для добавления комментария.
Рейтинги
HTML-code and BB-code for blogs and forums

<a href="https://php-fusion.vveb.ws/php-fusion.php?id=9">utf8_cp1251_strlen Функция считает количество символов в строке в русской кодировке UTF8</a>


[url=https://php-fusion.vveb.ws/php-fusion.php?id=9]utf8_cp1251_strlen Функция считает количество символов в строке в русской кодировке UTF8[/url]

Language: Default
 
Код для PHP-Fusion