Ver Mensaje Individual
  #17 (permalink)  
Antiguo 21/10/2009, 12:54
Avatar de angel1993
angel1993
 
Fecha de Ingreso: octubre-2009
Mensajes: 752
Antigüedad: 15 años, 5 meses
Puntos: 22
Respuesta: ayuda limitar caracteres a la hora de mostrar

Joer xD
Aver os paso mi código entero por que creo que lo estoy haciendo fatal

<?php
$texto =cortar($row['titulo'],20);
include ("conexion.php");
$sql2=mysql_query("select titulo,seccion,idtube from videos order by id DESC limit 4",$conexion) or die ("problema en la Select:".mysql_error());
while($row=mysql_fetch_array($sql2))
{
function cortar($texto, $cuantos = 33)
{
if (strlen($texto) <= $cuantos)
return $texto;
return substr($texto, 0, $cuantos) . '...';
}
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="387" bgcolor="#202020" class="Estilo2">';

Continua.. pero os pongo el primer trozo..