1
我試圖將標題存儲在數組中,並從下面的URL中提取長cmcontinue字符串。json解碼爲陣列
我當前的代碼:
$url = 'http://en.wikipedia.org/w/api.php?
action=query&list=categorymembers&cmtitle=Category:'.$cat.'&format=json';
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, "asdf");
$c = curl_exec($ch);
$json = json_decode($c);
$array = $json->{'query'}->{'categorymembers'}->{'title'};
什麼是你遇到的問題?等一下。你問完美的問題與你的暱稱:) – SuitedSloth