Beispiel #1
0
 public static function CheckWords($String, $Limite, $Pointer = null)
 {
     self::$Data = strip_tags(trim($String));
     self::$Format = (int) $Limite;
     $ArrWords = explode(' ', self::$Data);
     $NumWords = count($ArrWords);
     $NewWords = implode(' ', array_slice($ArrWords, 0, self::$Format));
     $Pointer = empty($Pointer) ? '...' : ' ' . $Pointer;
     $Result = self::$Format < $NumWords ? $NewWords . $Pointer : self::$Data;
     return $Result;
 }