Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/06/2013, 23:22
fakieboris
 
Fecha de Ingreso: mayo-2013
Mensajes: 35
Antigüedad: 11 años, 6 meses
Puntos: 0
Recorrer stdClass

Bien voy a ser directo he visto los ejemplos y preguntas que han hecho en el foro al respecto, a todos le funciona pero en mi caso no. si imprimo con un print_r el objeto me sale lo siguiente:

Array ( [0] => stdClass Object ( [trends] => Array ( [0] => stdClass Object ( [name] => #WhatMakesMeMad [url] => http://twitter.com/search?q=%23WhatMakesMeMad [promoted_content] => [query] => %23WhatMakesMeMad [events] => ) [1] => stdClass Object ( [name] => #MeGustasTú [url] => http://twitter.com/search?q=%23MeGustasT%C3%BA [promoted_content] => [query] => %23MeGustasT%C3%BA [events] => ) [2] => stdClass Object ( [name] => #3OT [url] => http://twitter.com/search?q=%233OT [promoted_content] => [query] => %233OT [events] => ) [3] => stdClass Object ( [name] => #NuncaFaltaElAmigoQue [url] => http://twitter.com/search?q=%23NuncaFaltaElAmigoQue [promoted_content] => [query] => %23NuncaFaltaElAmigoQue [events] => ) [4] => stdClass Object ( [name] => #SintomasDeUnWeyCursi [url] => http://twitter.com/search?q=%23SintomasDeUnWeyCursi [promoted_content] => [query] => %23SintomasDeUnWeyCursi [events] => ) [5] => stdClass Object ( [name] => Johnny Tsunami [url] => http://twitter.com/search?q=%22Johnny+Tsunami%22 [promoted_content] => [query] => %22Johnny+Tsunami%22 [events] => ) [6] => stdClass Object ( [name] => F-bomb [url] => http://twitter.com/search?q=F-bomb [promoted_content] => [query] => F-bomb [events] => ) [7] => stdClass Object ( [name] => Chelsea Dagger [url] => http://twitter.com/search?q=%22Chelsea+Dagger%22 [promoted_content] => [query] => %22Chelsea+Dagger%22 [events] => ) [8] => stdClass Object ( [name] => Boston [url] => http://twitter.com/search?q=Boston [promoted_content] => [query] => Boston [events] => ) [9] => stdClass Object ( [name] => Game 1 [url] => http://twitter.com/search?q=%22Game+1%22 [promoted_content] => [query] => %22Game+1%22 [events] => ) ) [as_of] => 2013-06-13T05:16:10Z [created_at] => 2013-06-13T05:14:52Z [locations] => Array ( [0] => stdClass Object ( [name] => Globales [woeid] => 1 ) ) ) )


No encuentro la manera de obtener name de todo los trends, he tratado usar foreach, con los ejemplos aqui vistos me corren sin novedad pero en este caso el arreglo de objetos me parece distinto sobre todo al principio donde dice de un vez "Array ( [0] => stdClass Object ( [trends] => Array..." creo que alli no me cuadra ya que viendo los ejemplos deberia empezar donde dice [trends] => Array...

Bueno solo lo digo, si alguien sabe como extraer name de alli que me ayude

gracias!