Posted By

andreiabohner on 12/27/09


Tagged

php String limit truncate characters


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

BrianCoyDesign


Truncate string length to n characters and use ...


 / Published in: PHP
 

  1. $max = 40;
  2. $desc = (strlen($desc)>$max)?(substr($desc, 0, $max).'...'):($desc);

Report this snippet  

You need to login to post a comment.