Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/01/2002, 15:54
Avatar de Ferdy
Ferdy
Colaborador
 
Fecha de Ingreso: junio-2001
Ubicación: España
Mensajes: 1.430
Antigüedad: 22 años, 9 meses
Puntos: 0
Re: Hacer ... en frases de mas longitud

Bueno, pues algo así valdría<pre>&lt;?php
//
// string corte(string str)
//
function corte($str)
{
if (empty($str))
{
return &quot;&quot;;
}
else if (strlen($str)&gt;15)
{
return (substr($str,0,12).&quot;...&quot;);
}
else
{
return $str;
}
}
?&gt; </pre>
Salu2

- Fernando Pereda ( Ferdy )
<center><a href="http://www.ferdyx.org/firmas.php"><img src="http://www.ferdyx.org/reg_tira.jpg" border="0"></a></center>