0

I am quite new to PHP and try to learn with small projects for my own. And now I am struggeling.

GOAL:

Problem: I have started trying to read RootData:Rate. See attached. But getting errors.

Warning: array_values() expects parameter 1 to be array, null given in stocks_scanner/etoro.php on line 12

Any Ideas? :-( Thanks a lot in advance! <3

<?php

//stock 
$stockurl = 'https://www.etoro.com/api/streams/v2/streams/user-trades/lee88eng'; // path to your JSON file
$stockdata = file_get_contents($stockurl); // put the contents of the file into a variable

$stockcharacters = json_decode($stockdata, true); // decode the JSON feed

//Array zu Variable
$timeseries = array_values($stockcharacters)['rootData'];
$close = array_values($timeseries)[0][1];
echo  "close is $close";

     
?>```


 
Pierre S.
  • 1
  • 1

0 Answers0