_filter_url_trim

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

modules/filter/filter.module, строка 858

Версии
5 – 6
_filter_url_trim($text, $length = NULL)

Shortens long URLs to http://www.example.com/long/url...

▾ 3 функции вызывают _filter_url_trim()

_filter_url in modules/filter/filter.module
URL filter. Automatically converts text web addresses (URLs, e-mail addresses, ftp links, etc.) into hyperlinks.
_filter_url_parse_full_links in modules/filter/filter.module
Make links out of absolute URLs.
_filter_url_parse_partial_links in modules/filter/filter.module
Make links out of domain names starting with 'www.'

Код

<?php
function _filter_url_trim($text, $length = NULL) {
  static $_length;
  if ($length !== NULL) {
    $_length = $length;
  }

  // Use +3 for '...' string length.
  if (strlen($text) > $_length + 3) {
    $text = substr($text, 0, $_length) .'...';
  }

  return $text;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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