我似乎无法让我的循环检测到我的变量中的字符串。在此代码中,它设置为“BRONZE”和“I”,并且似乎没有正确进行比较检查。任何关于为什么的指针?
$teir = $league->data->summonerLeagues[0]->tier;
echo $teir;
$rank = $league->data->summonerLeagues[0]->requestorsRank;
echo '<pre>';
print_r($rank);
echo '</pre>';
if($tier === "BRONZE")
{
${"s".$count."v"} += 0;
}
else if($teir == "SILVER")
{
${"s".$count."v"} += 5;
}
else if($teir == "GOLD")
{
${"s".$count."v"} += 10;
}
else if($teir == "PLATINUM")
{
${"s".$count."v"} += 15;
}
else
{
${"s".$count."v"} += 20;
}
if($rank == "V")
{
${"s".$count."v"} += 1;
}
else if($rank == "IV")
{
${"s".$count."v"} += 2;
}
else if($rank == "III")
{
${"s".$count."v"} += 3;
}
else if($rank == "II")
{
${"s".$count."v"} += 4;
}
else
{
${"s".$count."v"} += 5;
}
echo '<pre>';
print(${"s".$count."v"});
echo '</pre>';
感谢你的帮助!