Php 使用dirkolbrich/Yahoo Finance查询库的Yahoo Finance索引
因此,我为亚洲和加拿大指数选择了几个,它们的值是正确的(我从 ,例如:Php 使用dirkolbrich/Yahoo Finance查询库的Yahoo Finance索引,php,laravel,Php,Laravel,因此,我为亚洲和加拿大指数选择了几个,它们的值是正确的(我从 ,例如: <select name="symbols[]"> <option label="Straits Times" value="^STI">Straits Times</option> </select> 我得到一个数组,其中包含我选择的值,但它不包含有关以下值的信息: ["data"]=> array(5) { [0]=> obje
<select name="symbols[]">
<option label="Straits Times" value="^STI">Straits Times</option>
</select>
我得到一个数组,其中包含我选择的值,但它不包含有关以下值的信息:
["data"]=>
array(5) {
[0]=>
object(stdClass)#234 (2) {
["symbol"]=>
string(7) "^GSPTSE"
["components"]=>
array(0) {
}
}
[1]=>
object(stdClass)#240 (2) {
["symbol"]=>
string(8) "CADUSD=X"
["components"]=>
array(0) {
}
我使用了他建议的方法:
indexList(array $symbol)
Query for an index which returns the symbol and name of the components. Several symbols may be passed as an array.
See http://finance.yahoo.com/intlindices?e=europe for more symbols to world indices. The caret ^ character must be part of the symbol.
$symbol = array('^GDAXI');
$data = $query->indexList($symbol)->get();
在源代码中,indexList方法如下所示:
/**
* get list of component for indices symbol from yahoo.finance.com
*
* @param array $symbol
*/
public function indexList(array $symbols)
{
$query = new IndexList($this->yql);
$this->query = $query->query($symbols);
return $this;
}
我是后端开发的初学者,因此如果我解释得不太清楚,我很抱歉,我将尝试向您提供您需要的详细信息。提前感谢您的帮助!为什么不在github的项目中发布此内容?我尝试过,但没有得到任何回应,我必须尽快找到解决方案为什么不在github的项目中发布此内容?我尝试过,但我得到了答案没有回应,我必须尽快找到解决方案
/**
* get list of component for indices symbol from yahoo.finance.com
*
* @param array $symbol
*/
public function indexList(array $symbols)
{
$query = new IndexList($this->yql);
$this->query = $query->query($symbols);
return $this;
}