我想从Json那里得到一些信息
请问我怎样才能拿到它?
curl :
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 3);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: ***"));
$html = curl_exec($ch);
curl_close($ch);
$values = json_decode($html);
$info = $values['a']['new'];
echo "$info";
世珍:
{"a":{"new":"someinfo..."}}
我试图得到里面是什么['新'];
1条答案
按热度按时间bttbmeg01#
您可以使用
jq
More Info用于您的json
使用者jq指令