Hızlı yanıt: kod örneği
Depending on your PHP configuration, this may be a easy as using:However, if isn't enabled on your system, you could read the data via CURL as follows:Incidentally, if you just want the raw JSON data, then simply remove the .
$jsonData = json_decode(file_get_contents('https://chart.googleapis.com/chart?cht=p3&chs=250x100&chd=t:60,40&chl=Hello|World&chof=json'));
allow_url_fopen
<?php $curlSession = curl_init(); curl_setopt($curlSession, CURLOPT_URL, 'https://chart.googleapis.com/chart?cht=p3&chs=250x100&chd=t:60,40&chl=Hello|World&chof=json'); curl_setopt($curlSession, CURLOPT_BINARYTRANSFER, true); curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true); $jsonData = json_decode(curl_exec($curlSession)); curl_close($curlSession);?>
json_decode