Posted By

tcelestino on 08/24/11


Tagged

wordpress


Versions (?)

Function excerpt to WordPress


 / Published in: PHP
 

Usage:

  1. function TruncateText ($str_text, $max_char) {
  2. if(strlen($str_text)>$max_char){
  3. return substr($str_text, 0, $max_char).'...';
  4. } else {
  5. return $str_text;
  6. }
  7. }

Report this snippet  

You need to login to post a comment.