Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/03/2010, 05:17
Avatar de angel1993
angel1993
 
Fecha de Ingreso: octubre-2009
Mensajes: 752
Antigüedad: 14 años, 6 meses
Puntos: 22
Respuesta: Crear Array cada 2 letras de una palabra

$cadena="0101010101010101010101";
$longitud=strlen($cadena);
$longitud=$longitud/2;
$item[01]='<img src="img/we.png" width="41" height="56" alt="we">';
$item[02]='<img src="img/ds.png" width="41" height="56" alt="ds">';
$item[03]='<img src="img/as.png" width="41" height="56" alt="as">';
$item[04]='<img src="img/tc.png" width="41" height="56" alt="tc">';
for ($i=1;$i<$longitud+1;$i++) {
$var=substr($cadena, $i*2-2,2);
echo $item[$var];
}

¿Por que no funciona lo rojo?