Return short text snippet function

function textSnippet($string,$length=200){
  return preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1));
}

Leave a Reply

Your email address will not be published.