我刚开始使用 Riot API,我一直在通过他们的排名来获取召唤师。我使用了该getChampion()
功能,但它检索的数据与其他已经在运行的站点不同。
我这样使用它:
<?php
include('php-riot-api.php');
include('FileSystemCache.php');
//testing classes
//using double quotes seems to make all names work (see issue: https://github.com/kevinohashi/php-riot-api/issues/33)
$summoner_name = "RiotSchmick";
$summoner_id = 585897;
$test = new riotapi('na');
$testCache = new riotapi('na', new FileSystemCache('cache/'));
$r = $test->getChampion(); echo "<pre>"; print_r($r);echo "</pre>";
this fetch array like this
[champions] => Array
(
[0] => Array
(
[id] => 266
[active] => 1
[botEnabled] =>
[freeToPlay] => 1
[botMmEnabled] =>
[rankedPlayEnabled] => 1
)
[1] => Array
(
[id] => 103
[active] => 1
[botEnabled] =>
[freeToPlay] =>
[botMmEnabled] =>
[rankedPlayEnabled] => 1
) ..................
在我使用$r->getSummoner(266); // 103
了所有 id 之后,我从上面的数组中得到了。但是我得到的召唤师名称与其他运行站点不同,例如http://na.op.gg/ranking/ladder/和http://quickfind.kassad.in/rankings/na(这两个站点的数据相同,但我的不一样)。