/**
* Text Manipulation Functions
* www.unexpectedit.com
*/
function html_cut_text($text,$limit) {
$max_code=8; // max for special code like ‰ á ...
if(($limit<>0)&&(strlen($text)>$limit)) {
$pos=strpos(substr($text,0,$limit+$max_code),';'); //find ;
if($pos) // cut when pass ;
$text=substr($text,0,$pos+1);
else //cut at limit
$text=substr($text,0,$limit);
return($text."...");
}
else
return($text); // return
}
- 10th, Jun 2010
-