即時嘗試創建的東西,允許我在ForEach 創建每次不同的數字。ForEach Array打印數字1-200
例如: TEAM24SEVEN | 1395LP | 159Wins | 51Losses Gilius 1v9 | 1315LP | 148Wins | 62Losses FNC Sp1rit | 1204LP | 135Wins | 45Losses
這裏是我的代碼需要實現它:
<?php
$rank = 0+1;
$entries = $getchallengerleaguerankingList->entries;
usort($entries, function($a,$b){
return $b->leaguePoints-$a->leaguePoints;
});
foreach($entries as $statSummaryz){
print '<p>'.$rank.'</p><p><b>' .$statSummaryz->playerOrTeamName. '</b> | <font color="blue">' .$statSummaryz->leaguePoints. '</font>LP | <font color="green">' .$statSummaryz->wins. '</font>Wins | <font color="red">' .$statSummaryz->losses.'Losses </font></p>';
}
?>
我不知道你需要什麼。你想生成一個像1,2,3,1,2,3,1,2,3,...的序列嗎? –
不清楚你要求/試圖達到的目標。你能改寫它嗎? – Jeff
它爲它打印出$排名然後1,然後再次來回打印2號等等... –