writer Posted June 19, 2008 Share Posted June 19, 2008 I've got this massive amount of data coming from a WSDL that produces movie theaters and times. It's for an open-source local news site that I'm going to be handing out to struggling newspapers I'm having trouble parsing this, or printing it, in the ways that I've learned so far in my nascent PHP career -- so I'd like to ask you guys: How do you print elements individual elements when the print_r($variable) command turns out like this? I wish it was like this: echo $results[0][theater]; But that produces this error: Fatal error: Cannot use object of type stdClass as array in /home/taylorwb/public_html/localmost/movies/test.php on line 9 Here's what an individual array element looks like: stdClass Object ( [Theater] => Array ( [0] => stdClass Object ( [Name] => CineArts at Palo Alto Square [Address] => 3000 El Camino Real, Bldg. #6, Palo Alto, CA [Movies] => stdClass Object ( [Movie] => Array ( [0] => stdClass Object ( [Rating] => PG-13 [Name] => Reprise [RunningTime] => 1 hr 43 mins [showTimes] => 1:30pm | 4:10pm | 7:00pm | 9:40pm ) [1] => stdClass Object ( [Name] => The Visitor [showTimes] => 2:00pm | 4:30pm | 7:10pm | 9:35pm ) ) ) ) Link to comment https://forums.phpfreaks.com/topic/110857-solved-printing-stdclass-objects-from-an-array/ Share on other sites More sharing options...
writer Posted June 19, 2008 Author Share Posted June 19, 2008 Nevermind! Got it all worked out Link to comment https://forums.phpfreaks.com/topic/110857-solved-printing-stdclass-objects-from-an-array/#findComment-568865 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.