我是 JSON 和 API 的新手,我想制作一个使用 StackOverflow API 的 PHP CLI 脚本。我给自己做了一把钥匙,到目前为止,这是我的代码:
<?php
//Call stack API .$key
$google_url = "http://api.stackoverflow.com/1.1/stats";
//Get and Store API results into a variable
$result = file_get_contents($google_url);
//$jsonArray = json_decode($result);
print_r($result);
//var_dump($jsonArray);
?>
但是print_r($result);
返回一些奇怪的字符。看不懂,能不能给点资料?任何帮助将不胜感激。整个项目将是一个关于 StackOverflow 帖子和评论的开源搜索引擎!