function acortar($texto,$longitud)
{
$texto_partido =
substr($texto,
0,
$longitud);
/// Condición que comprueba la longitud del texto para devolverlo con ... o entero
if (strlen($texto) >
$longitud)
return $texto_partido."...";
else
return $texto;
}
1 comment about "Acortar texto con php"
http://www.posteet.com/view/642
Espero les sirva de mucho.
Saludos regoremor
regoremor on January 01, 2008