advanced code snippet search
ricosushi on 07/14/10
text excerpt cuts
07/14/10 08:26am
1 person have marked this snippet as a favorite
ricosushi
Returns a short string from a long string and adds "..." to the end of the string.
function excerpt($texto,$n_chars){ return (strlen($texto)>$n_chars)?substr($texto,0,$n_chars)."...":$texto; }
Report this snippet Tweet
Comment:
You need to login to post a comment.