Ver Mensaje Individual
  #21 (permalink)  
Antiguo 08/09/2014, 13:11
mikehove
 
Fecha de Ingreso: abril-2012
Ubicación: Argentina
Mensajes: 215
Antigüedad: 12 años, 9 meses
Puntos: 2
Respuesta: Arrays sin guión al principio

Este es el aviso en pantalla:

Código:
Notice: Array to string conversion in C:..... line 23

Array > Portasahumerios
Línea 23:

Código:
echo implode(' > ',$res);
Este es el código completo:

Código:
function get_path($id){
   $result = mysql_query('SELECT name, parent_id FROM categorias WHERE id='.$id);
   $row = mysql_fetch_array($result);
   $ret=array();
   if ($row['parent_id'] != NULL){
       $ret[]=get_path($row['parent_id']);
       //echo ' > ';
       //echo $row['name'];
      $ret[]=$row['name'];
   }
   return $ret;
}
 
$res=get_path(9);
 
echo implode(' > ',$res);