Re: [PHP-ES] una de arrays

[email protected] (Antonio Galicia)
Newsgroups php.general.es
Message-ID <CAGYn=Y2FrhuHGqnFO2rtyGgSoD3iU9OUozzst1ZtRZs4RkGCUA@mail.gmail.com>
2011/12/22 Irantzu Leunda Biskarret <[email protected]>:

> Habia puesto algo así, pero no funciona
> $S_SUB_DEST = array('apellidos');
>  foreach($S_SUB_DEST as $values)
>  {
>  $value = "pa_".$values;
>  $matriz = array();
>  }

Lo que tienes que hacer es caminar por todo tu array si tiene guión
agregarlo a otro array más cómodo de procesar.

foreach($tuarr as $k=>$v)
{
  if(strstr('-',$k))
  {
    list($a,$i)=explode('-',$k);
    $atletas[$i][$a]=$v;
  }
}

al final sólo caminas sobre $atletas. Eso debe funcionar. Lo estoy
haciendo de memoria así que tienes que corregir y probar.

--
 Saludos,
 PP
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.