Hi,
When I’m running cURL on my PHP code, it always returns NULL value. When I’m running it from shell then it’s working correctly.
My PHP code is:
data=array(′ip′=>′162.209.106.137′,′reverse−lookup′=>′false′);curl = curl_init();
curl_setopt(curl,CURLOPTURL,"https://community−neutrino−ip−info.p.mashape.com/ip−info");curlsetopt(curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt(curl,CURLOPTPOST,1);curlsetopt(curl, CURLOPT_HTTPHEADER, array(‘X-Mashape-Key: gaqUL3298fmshIcz27izfRgcMdnkp1cWtjUjsntxmpSbuS6xSP’));
curl_setopt(curl,CURLOPTSSLVERIFYPEER,false);curlsetopt(curl, CURLOPT_POSTFIELDS, data);result = curl_exec(curl);if(!result) {
echo curl_error(curl);
}
curl_close(curl);
var_dump(json_decode($result, true));
Hi gruszka,
Try this PHP code snippet here: https://www.neutrinoapi.com/api/api-examples/php/
You’ll need to create a new API key here as well: https://www.neutrinoapi.com/signup/