Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/06/2013, 00:19
self
 
Fecha de Ingreso: noviembre-2012
Mensajes: 54
Antigüedad: 11 años, 5 meses
Puntos: 0
Respuesta: stdclass object php imprimir solo dos valores

tambien lo intente asi, pero no funciono....

Código PHP:
Ver original
  1. <?php
  2.  $url="https://gdata.youtube.com/feeds/api/users/lafuenteuy/favorites?v=2&alt=jsonc";
  3.  $json = file_get_contents($url,0,null,null);
  4.  $datos = json_decode($json);
  5.  
  6. foreach($datos->data->items as $index => $objecto)
  7. {
  8.             print $objecto[0]->video->id; //para el id
  9.             echo'<br>';
  10.             print $objecto[1]->video->id; //para el id
  11.  
  12. }
  13.  
  14.  
  15.  
  16.  
  17.  
  18. ?>