Posted By

mfigge on 07/14/10


Tagged

text crop


Versions (?)

Corta los primeros n caracteres de un texto, pero busca el espacio para no cortar una palabra


 / Published in: PHP
 

  1. if (strlen($texto) > 500) {
  2. $texto = substr($texto,0,strpos($texto," ",500))." ...";
  3. }

Report this snippet  

You need to login to post a comment.