Leider verstehe ich nicht, warum das Programm
nicht läuft. Es tauchen immer wieder neue Fehlermeldungen auf wie z.B. bezgl. des { nach else. Kann mir jemand weiterhelfen?
PHP-Code:
<?php
//Getting his*to*ri*cal quo*tes
function loadQuotes($Symbol)
{
$lineCount = 0;
$days = ar*ray();
// mo*di*fy pa*ra*me*ters
// load the his*to*ri*cal stock quo*tes: we are ope*ning it for rea*ding
$URL="https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=$Symbol&apikey=demo&datatype=csv";
$fi*le*Hand*le = fo*pen ($URL,"r");
if ($fi*le*Hand*le) {
// use the fgetcsv func*tion to store quo*te va*lues in*to a ar*ray $li*neVa*lues
// store one sym*bol in one li*ne
do {
$stock*Va*lues = fgetcsv ($fi*le*Hand*le, 999999, ",");
if ($stock*Va*lues) {
$lineCount++;
$days[$lineCount] = $stock*Va*lues;
}
} while ($stock*Va*lues);
// clo*se hand*le
fc*lo*se ($fi*le*Hand*le);
} el*se {
$days[0][0] = "ERROR";
$days[0][1] = "No da*ta found.";
}
re*turn $days;
}
$Stokes=loadQuotes("MSFT");
print_r($Stokes);
?>

Kommentar