Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/03/2013, 09:35
Avatar de miguec04
miguec04
 
Fecha de Ingreso: agosto-2008
Ubicación: Cimitarra, Santander
Mensajes: 378
Antigüedad: 15 años, 8 meses
Puntos: 15
Respuesta: Como paso esto a string

vale mira, has un metodo recursivo de la siguiente forma:

Código PHP:
Ver original
  1. $bien       = array('ultimo'=>'nivel');
  2. $otro       = array('uno'=>'hola','dos'=>'mundo','nivel'=>$bien);
  3. $vector     = array('prueba'=>'valor','otro'=>$otro);
  4. function getMetodo($vectorB) {
  5.     $string     = '';
  6.     $string .='<table>';
  7.     foreach($vectorB as $vec => $var) {
  8.         if(is_array($var)) {
  9.             $string .= '<tr><td style="padding-left:10px;">'.getMetodo($var).'</td></tr>';
  10.         } else {
  11.             $string .= '<tr><td>Llave: '.$vec.': '.$var.'</td></tr>';
  12.         }
  13.     }
  14.     $string .= '</table>';
  15.    
  16.     return $string;
  17. }
  18. echo getMetodo($vector);
acomoda mi ejemplo a tu necesidad, yo intente simular tu array en uno que cree me dices si te sirvió
__________________
Desoftc Technology - Miguel Carmona
Creaciones Inteligentes - Cimitarra Colombia
[email protected]
http://www.desoftc.com.co