<?php

class Zend_View_Helper_CropText extends Zend_View_Helper_Abstract {
  

  
 

  public function cropText($str,$qtde,$final=''){
    $tam = strlen($str);
  if(strlen($str) > $qtde){
    
    $indice = 0;
    for($x=$qtde; $x < strlen($str); $x++){
      if($str[$x] ==" "){
        $indice = $x;
        break;
      }
    }
    $str = substr($str,0,$x).$final;
  }
  return $str;
  
}

}