I am trying to get data from a multi associative json array and was wondering how i would access information such as 20-18-04-06 or the one following ive tried to foreach through the array but it only returns the first array given (array 4) while to arrays im trying to access is array 7
array:2 [▼
"Meta Data" => array:4 [▼
"1. Information" => "Monthly Adjusted Prices and
Volumes"
"2. Symbol" => "AAPL"
"3. Last Refreshed" => "2018-04-06"
"4. Time Zone" => "US/Eastern"
]
"Monthly Adjusted Time Series" => array:219 [▼
"2018-04-06" => array:7 [▼
"1. open" => "167.8800"
"2. high" => "174.2304"
"3. low" => "164.4700"
"4. close" => "168.3800"
"5. adjusted close" => "168.3800"
"6. volume" => "164408813"
"7. dividend amount" => "0.0000"
]
"2018-03-29" => array:7 [▼
"1. open" => "178.5400"
"2. high" => "183.5000"
"3. low" => "164.9400"
"4. close" => "167.7800"
"5. adjusted close" => "167.7800"
"6. volume" => "701387082"
"7. dividend amount" => "0.0000"
]
I've tried to reach the array it but it only returns the top results
"Meta Data" => array:4 [▼
"1. Information" => "Monthly Adjusted Prices and
Volumes"
"2. Symbol" => "AAPL"
"3. Last Refreshed" => "2018-04-06"
"4. Time Zone" => "US/Eastern"
]
my control is below any help is greatly appreciated.
$client = new Client(); //GuzzleHttp\Client
$promise = $client->get('https');
$body = $promise->getbody();
$result = json_decode($body,true);
foreach ($result as $key => $value) {
return view('pages.test', ['re' => $value]);
}