Skip to content

Instantly share code, notes, and snippets.

@davidvanvickle
Created September 22, 2011 02:36
Show Gist options
  • Save davidvanvickle/1233897 to your computer and use it in GitHub Desktop.
Save davidvanvickle/1233897 to your computer and use it in GitHub Desktop.
php curl get json
$ch = curl_init('http://domain.com?'.http_build_query(array('type'=>'stuffIndex','request'=>'getIt')));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$resp = curl_exec($ch);
curl_close($ch);
$d = json_decode($resp,true);
if ($d && isset($d['akey'])) {
}
@Alfnitacoder
Copy link

Alfnitacoder commented Jan 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment