Blame view

app/components/Text.php 391 Bytes
bf807468   Alex Savenko   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <?php 

  namespace app\components;

  class Text

  {

      public static function getShort($text,$count){

          $text=strip_tags($text);

          if(mb_strlen($text, 'UTF-8')>$count)

          {

          //$pos = mb_strpos($text, ' ', $count, 'UTF-8');

          $text = mb_substr($text, 0, $count, 'UTF-8');

          return $text.'...';

          }

          else

          return $text;

      }

  }