Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/01/2011, 11:23
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: Funcion mostrar matriz

con esto ves todo lo quieres:

Código PHP:
Ver original
  1. $moviles = array("m nextel" => "12345678",
  2. "m telcel" => "987654321",
  3. "m movistar"=> "6574839201");
  4. $telefonos = array("t trabajo" => "7296489",
  5. "t casa" => "5689524",
  6. "t movil" => $moviles);
  7. $agenda = array("domicilio" => "calle tal cual",
  8. "telefono" => $telefonos,
  9. "trabajo" => "empresa tal cual");
  10. print_r($agenda);
  11. if(is_array($agenda)){
  12.     foreach ($agenda as $key => $value){
  13.         if(is_array($value)){
  14.             echo $key.' - '.' <br >';
  15.             foreach ($value as $key2 => $value2){
  16.                     if(is_array($value2)){
  17.                         echo $key2.' -  <br >';
  18.                         foreach ($value2 as $key3 => $value3){
  19.                             echo $key3.' - '.$value3.'<br >';
  20.                         }
  21.                     }else{
  22.                         echo $key2.' - '.$value2.' <br >';
  23.                     }
  24.                 }
  25.         }else{
  26.             echo $key.' - '.$value.' <br >';
  27.         }
  28.     }
  29. }