Support the ongoing development of Laravel.io →
posted 10 years ago
Requests

I am fetching data from http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=shahrukh khan and I am geting response when I use the following code to store some fields of the returned data I get errors

/** fetch image from google images **/ $url = "http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=".$api_q."&userip=".Request::getClientIp(); $body = json_decode(file_get_contents($url)); /dd($body);/ foreach($body as $bodies) { $cover = $bodies->url; } dd($cover);

I have also tried for loop and then $body[$i]->url; and every possible solution I can think of

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

khanof89 khanof89 Joined 4 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.