I'm confused about how I can echo a certain element in my JSON array.
Under time series (1min), I would like to output 1. open. In order to give me the actual value for it.
So far, i'm only able to output the complete array.
Link to JSON file is: https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo
Also, i'm using wordpress.
Here is the code i'm using:
$request = wp_remote_get('https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=demo');
if( is_wp_error( $request ) ) {
return false; // Bail early
}
$body = wp_remote_retrieve_body( $request );
$data = json_decode($body, true);
echo $body;
</div>