Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/03/2008, 19:51
Avatar de Italico76
Italico76
 
Fecha de Ingreso: abril-2007
Mensajes: 3.303
Antigüedad: 17 años
Puntos: 292
Re: Como indexar array al estilo C++ en php

Código PHP:
<?
$cadena 
"A:1#B:2#C:3#D:4#E:1986#";
$do preg_match("/([A-Z]:[0-9]{1,}#)([A-Z]:[0-9]{1,}#)([A-Z]:[0-9]{1,}#)([A-Z]:[0-9]{1,}#)([A-Z]:[0-9]{1,}#)/"$cadena$matches);

If (
$do){
  
//print_r($matches);    
  
For ($i=1;$i<count($matches);++$i){
  
$matches[$i]= substr($matches[$i],2,strlen($matches[$i])-3);
  echo 
$matches[$i]."<br/>";
  }
  
}
?>
Listo!
__________________
Salu2!