我寫了一個多重捲曲,它輸出兩個不同的陣列多個cURL並輸出JSON?
我正在使用curl_multi_getcontent。
for($i = 0; $i < $node_count; $i++)
{
$results = curl_multi_getcontent ($curl_arr[$i] );
$results = json_decode($results,true);
/*echo "<pre>";
print_r($results);
echo "</pre>";*/
}
這將輸出兩個數組。如果我想從一個數組中獲取數據,我該如何調用第一個數組?或第二個數組?
有什麼樣的結果$ [0]或東西第一陣列
foreach($results[0] as $result){
echo $result['pagination'];
}
這並不表明JSON字符串,它只是 '陣列 { [0] => [1] => }'和孤單那些 – hellomello
沒有價值,你在'$ curl_arr有什麼數據數組? – dchrastil
我沒有改變任何關於你的捲曲對象,所以它應該有相同的陣列,你說它在你的原始文章中打印出來。如果你包含更多的代碼,這將有所幫助。 – dchrastil