Public paste
Hmzz
By: Xmoo | Date: May 7 2009 13:13 | Format: PHP | Expires: never | Size: 216 B | Hits: 560

  1. <?php  
  2. function short_text($string, $digits)
  3.  {  
  4.  $count = strlen($string);
  5.  if($count > $digits)
  6.   {
  7.   $string = substr("$string", 0, $digits);
  8.   $string = "$string...";
  9.   }
  10.  return $string;
  11. }
  12. ?>