Equivalent of file_get_contents() with CURL?

Viewed 10602

I'm trying to get some JSON data from a url like this:

$url = 'http://site.com/search.php?term=search term here';
$result = json_decode ( file_get_contents($url) );

However the client's webhost has got the allow_url_fopen setting disabled, hence the code above doesn't work.

What's the equivalent code of the lines above? Basically, a search term needs to be submitted via $_GETto the url.

5 Answers
Related