drupal_strlen

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/unicode.inc, строка 400

Версии
5 – 6
drupal_strlen($text)

Count the amount of characters in a UTF-8 string. This is less than or equal to the byte count.

▾ 7 функции вызывают drupal_strlen()

node_teaser in modules/node/node.module
Создаёт анонс для тела ноды.
search_expand_cjk in modules/search/search.module
Basic CJK tokenizer. Simply splits a string into consecutive, overlapping sequences of characters ('minimum_word_size' long).
search_index in modules/search/search.module
Обновляет полнотекстовый поисковый индекс для указанного элемента.
theme_username in includes/theme.inc
Форматирует имя пользователя.
truncate_utf8 in includes/unicode.inc
Безопасно обрезает кодированную в UTF-8 строку до указанного количества символов.
_form_validate in includes/form.inc
Performs validation on form elements. First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validators.
_search_parse_query in modules/search/search.module
Helper function for search_parse_query();

Код

<?php
function drupal_strlen($text) {
  global $multibyte;
  if ($multibyte == UNICODE_MULTIBYTE) {
    return mb_strlen($text);
  }
  else {
    // Do not count UTF-8 continuation bytes.
    return strlen(preg_replace("/[\x80-\xBF]/", '', $text));
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему