Neither this...$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.coingecko.com/api/v3/coins/bitcoin/history?date=29-08-2019&localization=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
$object = json_decode($response);
$usdVal = $object->market_data->current_price->usd;
echo $usdVal;
Nor this...ini_set('max_execution_time', 300);
$url ='https://api.coingecko.com/api/v3/coins/bitcoin/history?date=29-08-2019&localization=false';
$data = file_get_contents($url);
$object = json_decode($data);
$usdVal = $object->market_data->current_price->usd;
echo $usdVal;
What am I doing wrong?