Logo white

Administrator / new_rukzachok-1

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • new_rukzachok-1
  • frontend
  • components
  • Text.php
  • second
    71bb42d5
    Administrator authored
    2016-05-06 17:56:13 +0300  
    Browse Code ยป
Text.php 381 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php 
namespace frontend\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;
    }
}