ydoisuck Posted March 22, 2011 Share Posted March 22, 2011 Hi i'm struggling to pull data from an stdClass Object which searches google for an item. This is the code that pulls out the information <?php $encoded_response = file_get_contents("https://www.googleapis.com/shopping/search/v1/public/products?key=AIzaSyDCrZzoEB46bliROIn8JgOImm0B5YvxbVY&country=US&q=0014633144796"); $response = json_decode($encoded_response); print_r($response); ?> (can be seen at:http://www.rafoggin.com/Shrop/googletestapi.php i've tried $object = $result[0]; $print = $object->kind; echo $print and foreach ($result->product as $print) { echo $print->googleId; and many other variations but can't get it to work. ideally i'd like to pull the images out, but the structure confuses me. Your help is really appreciated, I can't figure this out. Link to comment https://forums.phpfreaks.com/topic/231339-pulling-from-a-stdclass-object-google-service/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.